@mcpjam/sdk
v0.1.4
Published
Official MCPJam SDK with reusable client utilities
Downloads
20
Readme
@mcpjam/sdk
The official MCPJam SDK provides utilities for building, testing, and developing MCP clients and servers. Built on top of the @modelcontextprotocol/sdk, it offers high-level abstractions and tools to accelerate MCP development.
Installation
npm install @mcpjam/sdkKey Features
MCPClientManager
The primary utility in the SDK is MCPClientManager, a powerful client manager for connecting to and interacting with MCP servers:
- Multi-server support - Manage multiple MCP server connections simultaneously
- All transports - STDIO, HTTP/SSE, and Streamable HTTP support
- Lifecycle management - Automatic connection handling and cleanup
- Tools, resources, prompts - Full MCP protocol support including elicitation
- Agent framework integration - Built-in adapters for Vercel AI SDK and other popular libraries
- OAuth & authentication - Bearer token and custom header support
Use Cases
The SDK is designed for:
- Building AI agents - Connect agents to MCP servers for tool access
- Creating MCP clients - Build custom clients with full protocol support
- Testing MCP servers - Write unit tests and E2E tests for your servers
- LLM applications - Add MCP support to chat applications and AI workflows
Quick Start
import { MCPClientManager } from "@mcpjam/sdk";
// Initialize with server configurations
const manager = new MCPClientManager({
// STDIO server
filesystem: {
command: "npx",
args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
},
// HTTP/SSE server with authentication
asana: {
url: new URL("https://mcp.asana.com/sse"),
requestInit: {
headers: {
Authorization: "Bearer YOUR_TOKEN",
},
},
},
});
// List and execute tools
const tools = await manager.getTools(["filesystem"]);
const result = await manager.executeTool("filesystem", "read_file", {
path: "/tmp/example.txt",
});
// Integrate with Vercel AI SDK
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";
const response = await generateText({
model: openai("gpt-4o-mini"),
tools: manager.getToolsForAiSdk(),
messages: [{ role: "user", content: "List files in /tmp" }],
});Documentation
For detailed documentation on MCPClientManager including:
- Connection configuration (STDIO, HTTP/SSE)
- Tool execution and resource management
- Elicitation handling
- Agent framework integrations
- API reference
See the MCPClientManager README.
Development
Building Locally
Build the entire SDK workspace:
npm run buildThis compiles all sub-packages including mcp-client-manager and generates distributable bundles.
Development Mode
Watch for changes and rebuild automatically:
npm run devResources
- 💬 Discord: Join the MCPJam Community
- 📖 MCP Protocol: Model Context Protocol Documentation
- 🔧 GitHub: MCPJam Inspector Repository
Contributing
We welcome contributions! The SDK is part of the MCPJam Inspector monorepo. Please see our Contributing Guide for guidelines.
License
Apache License 2.0 - see the LICENSE file for details.
Built with ❤️ for the MCP community • 🌐 MCPJam.com
