A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
An MCP client library for building conversational AI applications with dynamic tool discovery for context-efficient agen
mcp-ts or toolkit even exist?MCP makes it possible for AI applications to talk to tools, prompts, and resources, but building applications on top of MCP quickly becomes more than calling listTools() and callTool().
You need to manage user sessions, OAuth flows, reconnects, storage, browser updates, framework adapters, and on-demand tool discovery so agents can load and call only what they need instead of flooding the model context, similar to Claude Code's advanced tool use.
mcp-ts exists to handle that application layer while keeping your MCP data in infrastructure you own or choose. See storage backends and framework adapters.
It gives you a practical foundation for building MCP-native apps:
ToolRouterCodeModeIn short: the official MCP SDK gives you the protocol building blocks. mcp-ts gives you the application layer for building MCP applications around them.
If you already use a managed service/platform such as Smithery, Klavis Strata, Composio, nango or a similar SDK, you may not need mcp-ts.
| Package | Description | Install |
|---|---|---|
| @mcp-ts/sdk | Core TypeScript/JavaScript SDK for client applications. | npm i @mcp-ts/sdk |
| @mcp-ts/tool-router | ToolRouter for dynamic tool discovery across many MCP servers. | npm i @mcp-ts/tool-router |
| @mcp-ts/codemode | CodeMode: sandboxed program execution for tool calling. | npm i @mcp-ts/codemode |
| mcpassistant-gateway | Python bridge for local MCP support in remote apps. | pip install mcpassistant-gateway |
Most features are available out-of-the-box in the TypeScript SDK:
useMcp hook for easy React integrationuseMcp composable for Vue applicationsCheck out working examples demonstrating the MCP Apps extension and agent integrations in the examples/agents directory.
Examples MCP Apps referred from modelcontextprotocol/ext-apps
|
|
Interactive UIs for MCP tools
I got the idea for
@mcp-tswhile working on MCP Assistant. As the project grew, I had a few problems: storage, using different AI frameworks like LangGraph and ADK for different use cases, and figuring out how to get progressive SSE updates at each step so I could see what was happening. So with that idea in mind, I built this SDK to make setup easier and keep the user experience smooth. That’s how@mcp-tsstarted.
npm install @mcp-ts/sdk
The SDK supports multiple storage backends out of the box:
npm install better-sqlite3)npm install ioredis)Working reference: examples/next
// app/api/mcp/route.ts
import { createNextMcpHandler } from '@mcp-ts/sdk/server';
export const dynamic = 'force-dynamic';
export const runtime = 'nodejs';
export const { GET, POST } = createNextMcpHandler({
authenticate: () => {
// your logic here
}
});
'use client';
import { useMcp } from '@mcp-ts/sdk/client/react';
function App() {
const { connections, connect } = useMcp({
url: '/api/mcp',
userId: 'user-123',
});
return (
<div className="flex flex-col items-center gap-4">
<button
onClick={() =>
connect({
serverId: 'my-server',
serverName: 'My MCP Server',
serverUrl: 'https://mcp.example.com',
callbackUrl: `${window.location.origin}/callback`,
})
}
>
Connect
</button>
{connections.map((conn) => (
<div key={conn.sessionId}>
<h3>{conn.serverName}</h3>
<p>State: {conn.state}</p>
<p>Tools: {conn.tools.length}</p>
</div>
))}
</div>
);
}
https://docs.mcp-assistant.in/mcpmcp-ts / toolkit documentation over MCP.https://api.mcp-assistant.in/mcpapi.mcp-assistant.in/mcp is the MCP Assistant server endpoint. It provides access to 100+ MCP servers such as GitHub, Notion, Zapier, and Supabase.CodeMode tool that executes programs inside a secure sandbox for programmatic tool calling, workflow execution, and result processing, avoiding expensive LLM tool-calling loops.{
"mcpServers": {
"mcp-assistant": {
"serverUrl": "https://api.mcp-assistant.in/mcp"
}
}
}
{
"servers": {
"mcp-assistant": {
"type": "http",
"url": "https://api.mcp-assistant.in/mcp"
}
}
}
Integrating with agent frameworks is simple using built-in adapters.
// app/api/chat/route.ts
import { MultiSessionClient } from '@mcp-ts/sdk/server';
import { AIAdapter } from '@mcp-ts/sdk/adapters/ai';
import { streamText } from 'ai';
import { openai } from '@ai-sdk/openai';
export async function POST(req: Request) {
const { messages, userId } = await req.json();
const client = new MultiSessionClient(userId);
try {
await client.connect();
const tools = await AIAdapter.getTools(client);
const result = streamText({
model: openai('gpt-4'),
messages,
tools,
onFinish: async () => {
await client.disconnect();
}
});
return result.toDataStreamResponse();
} catch (error) {
await client.disconnect();
throw error;
}
}
import { MultiSessionClient } from '@mcp-ts/sdk/server';
import { AguiAdapter } from '@mcp-ts/sdk/adapters/agui-adapter';
const client = new MultiSessionClient("user_123");
await client.connect();
const adapter = new AguiAdapter(client);
const tools = await adapter.getTools();
import { MultiSessionClient } from '@mcp-ts/sdk/server';
import { MastraAdapter } from '@mcp-ts/sdk/adapters/mastra-adapter';
const client = new MultiSessionClient("user_123");
await client.connect();
const tools = await MastraAdapter.getTools(client);
Execute MCP tools server-side when using remote agents (LangGraph, AutoGen, etc.):
import { HttpAgent } from "@ag-ui/client";
import { AguiAdapter } from "@mcp-ts/sdk/adapters/agui-adapter";
import { createMcpMiddleware } from "@mcp-ts/sdk/adapters/agui-middleware";
// Connect to MCP servers
const { MultiSessionClient } = await import("@mcp-ts/sdk/server");
const client = new MultiSessionClient("user_123");
await client.connect();
// Create adapter and get tools
const adapter = new AguiAdapter(client);
const mcpTools = await adapter.getTools();
// Create agent with middleware
const agent = new HttpAgent({ url: "http://localhost:8000/agent" });
agent.use(createMcpMiddleware({
toolPrefix: 'server-',
tools: mcpTools,
}));
The middleware intercepts tool calls from remote agents, executes MCP tools server-side, and returns results back to the agent.
Render interactive UIs for your tools using McpAppRenderer.
import { useRenderToolCall } from "@copilotkit/react-core";
import { McpAppRenderer } from "@mcp-ts/sdk/client/react";
import { useMcpContext } from "./mcp";
export function ToolRenderer() {
const { mcpClient } = useMcpContext();
useRenderToolCall({
name: "*",
render: ({ name, args, result, status }) => (
<McpAppRenderer
client={mcpClient}
name={name}
input={args}
result={result}
status={status}
/>
),
});
return null;
}
Full documentation is available at: Docs
The library supports multiple storage backends. You can explicitly select one using MCP_TS_STORAGE_TYPE or rely on automatic detection.
Supported Types: redis, supabase, neon, sqlite, file, memory.
Redis (Recommended for production)
MCP_TS_STORAGE_TYPE=redis
REDIS_URL=redis://localhost:6379
SQLite (Fast & Persistent)
MCP_TS_STORAGE_TYPE=sqlite
# Optional path
MCP_TS_STORAGE_SQLITE_PATH=./sessions.db
Neon (Serverless Postgres)
MCP_TS_STORAGE_TYPE=neon
NEON_DATABASE_URL=postgresql://user:password@host.neon.tech/dbname?sslmode=verify-full&channel_binding=require
File System (Great for local dev)
MCP_TS_STORAGE_TYPE=file
MCP_TS_STORAGE_FILE=./sessions.json
In-Memory (Default for testing)
MCP_TS_STORAGE_TYPE=memory
The MCP Gateway is a Python-based bridge that allows local MCP servers to be accessed by remote applications via an outbound connection. This is useful for providing local context (like your filesystem) to a hosted AI agent.
pip install mcpassistant-gateway
You can run the gateway using uvx or pip:
# Run the interactive menu
uvx mcpassistant-gateway menu
# Run the bridge directly
uvx mcpassistant-gateway run --name "local-files"
The MCP Toolkit supports two common runtime topologies:
graph LR
subgraph Direct["Direct SDK Flow (TypeScript)"]
UI[Browser UI]
Hook[useMcp Hook]
API[Next.js /api/mcp]
Mgr[MultiSessionClient]
Store[(Redis/File/Memory)]
MCP[MCP Servers]
UI <--> Hook
Hook -- "HTTP RPC" --> API
API --> Mgr
Mgr -- "SSE events" --> Hook
Mgr <--> Store
Mgr <--> MCP
end
subgraph Bridge["Remote Bridge Flow (Python)"]
direction TB
Spacer[" "]
Agent[mcpassistant-gateway]
Remote[Remote Bridge Server]
LocalMcp[Local MCP Servers]
Spacer --- Agent
Agent -- "WSS /connect (outbound)" --> Remote
Agent <--> LocalMcp
style Spacer fill:transparent,stroke:transparent,color:transparent
end
useMcp over HTTP + SSE to a server route backed by MultiSessionClient.mcpassistant-gateway keeps an outbound authenticated WebSocket to a remote bridge and forwards tool calls to local MCP servers.[!NOTE] This package (
@mcp-ts/sdk) provides a unified MCP client with support for adapters and storage backends such as AI SDK, Mastra, LangChain, and Redis. Adapters and storage backends are loaded via optional peer dependencies and must be installed independently. This ensures your application only includes the integrations you explicitly choose, keeping bundle size small and avoiding unnecessary dependencies. The SDK includes built-in support for Memory and File storage, while additional backends (such as Redis) and adapters can be added without impacting users who don't need them.
For more details, refer to the documentation and follow the installation guide for each adapter or storage backend.
Contributions are welcome! Please read CONTRIBUTING.md for guidelines on how to contribute.
Thanks for visiting @mcp-ts!
MCP server integration for DaVinci Resolve Studio
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
A Jetbrains IDE IntelliJ plugin aimed to provide coding agents the ability to leverage intelliJ's indexing of the codeba