Skip to main content
MCP (Model Context Protocol) servers let you bundle multiple tools together and connect Claude to external services. The Chucky SDK supports several types of MCP servers.

Overview

Client Tools

SDK-defined
  • Runs in your app process
  • Full access to app state

Stdio Server

Subprocess
  • External process
  • stdio communication
  • Any language

SSE Server

Streaming
  • Server-Sent Events
  • Real-time updates

HTTP Server

REST API
  • REST API endpoint
  • Stateless
  • Any backend

Client Tools (Most Common)

Tools that run directly in your application, with handlers you define:

When to Use

  • Tools that need access to your app’s state
  • Browser tools (DOM manipulation)
  • Tools that call your own APIs
  • Simple integrations

Stdio Servers

External processes that communicate via stdin/stdout. Great for using existing MCP servers or tools written in other languages.

Configuration Options

When to Use

  • Using existing MCP servers from the ecosystem
  • Tools written in Python, Go, Rust, etc.
  • Complex tools that benefit from process isolation
  • Tools with heavy dependencies

Available MCP Servers

Popular pre-built servers:

SSE Servers

Connect to Server-Sent Events endpoints for real-time streaming tools:

Configuration Options

When to Use

  • Real-time data sources
  • Long-running connections
  • Server-push updates
  • Live monitoring tools

HTTP Servers

Connect to REST API endpoints:

Configuration Options

When to Use

  • Existing REST APIs
  • Serverless functions
  • Third-party integrations
  • Stateless tools

Combining Multiple Servers

Use multiple MCP servers together:

Tool Naming

When using MCP servers, tools are namespaced:
For example:
Claude uses the full name internally, but you can reference tools by their short name in allowedTools and disallowedTools:

Building an MCP Server

Simple Server

With Zod Schemas


Error Handling

Always handle errors in tool handlers:
Claude will see the error and can:
  • Try a different approach
  • Ask for clarification
  • Report the issue to the user

Result Types

Text Result

Error Result

Image Result

Multi-Content Result


Best Practices

1. Clear Descriptions

Help Claude understand when to use each tool:

2. Validate Inputs

Don’t trust input from Claude blindly:

3. Limit Output Size

Claude has context limits:

4. Add Rate Limiting

Prevent abuse:

Next Steps

Tools

Tool basics and creation

Sessions

Multi-turn conversations

Session Options

Complete options reference

Error Handling

Handle errors gracefully