About ZapToMCP
ZapToMCP is a work-in-progress monorepo of TypeScript packages for building MCP servers and clients. Its SDK provides typed APIs and several transport options, while a higher-level package abstracts server creation.
Key features
- 01TypeScript MCP SDK
- 02Typed APIs
- 03In-memory, SSE, stdio, and HTTP transports
- 04Higher-level server abstraction
- 05ESM and CommonJS support
Use cases
- 01Building an MCP server in TypeScript
- 02Creating an MCP client with the SDK
- 03Choosing a transport for an MCP connection
MCP support
The monorepo provides an MCP TypeScript SDK and a higher-level server package. The SDK supports in-memory, SSE, stdio, and streamable HTTP transports for server and client implementations.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEZapToMCP
⚠️ Work in Progress
Warning: This repository is currently under active development. The API and implementation details are subject to change. Use at your own risk.
ZapToMCP is a monorepo containing tools and libraries for building Model Context Protocol (MCP) servers and clients. It provides a streamlined way to create, deploy, and manage MCP-compatible services.
Overview
The Model Context Protocol (MCP) is an open standard for communication between AI assistants and tools. ZapToMCP simplifies the process of building MCP-compatible servers and clients, allowing developers to focus on creating powerful AI experiences rather than implementing protocol details.
Repository Structure
This monorepo contains the following packages:
@zaptomcp/sdk: A TypeScript implementation of the Model Context Protocol@zaptomcp/server: A higher-level abstraction for creating MCP servers- More packages coming soon...
Getting Started
Prerequisites
- Node.js >= 20
- pnpm >= 10.8.1
Installation
Clone the repository:
git clone https://github.com/hoghweed/zaptomcp.git
cd zaptomcp
Install dependencies:
pnpm install
Installation
# Install dependencies
pnpm install
# Bootstrap the monorepo
pnpm bootstrap
Development
Available Scripts
pnpm dev: Start development mode for all packagespnpm build: Build all packagespnpm clean: Clean build artifactspnpm lint: Run linting across all packagespnpm format: Format code across all packagespnpm typecheck: Run type checking across all packagespnpm commit: Create a commit using conventional commit format
Code Quality
This project uses:
- Biome for linting and formatting
- TypeScript for type checking
- Husky for git hooks
- Commitlint for commit message validation
@zaptomcp/sdk
The SDK package provides a TypeScript implementation for interacting with the Model Context Protocol (MCP).
Features
- Multiple transport implementations:
- In-memory
- SSE (Server-Sent Events)
- Stdio
- Streamable HTTP
- Type-safe API
- Built with Fastify for high performance
- Support for both ESM and CommonJS
Installation
pnpm add @zaptomcp/sdk
Usage
Usage Creating an MCP Server
import { McpServer } from '@zaptomcp/sdk';
// Create a server with basic information
const server = new McpServer(
{
name: "my-mcp-server",
version: "1.0.0"
},
{
capabilities: {
// Define your server capabilities
sampling: {},
prompts: {},
resources: {},
tools: {},
logging: {}
},
instructions: "This is an MCP-compatible server"
}
);
// Connect the server to a transport
import { FastifyTransport } from '@zaptomcp/sdk/transports';
const transport = new FastifyTransport();
await server.connect(transport);
// Start listening for requests
await transport.listen(3000);
console.log("MCP server running on port 3000");
Creating an MCP Client
import { Client } from '@zaptomcp/sdk';
// Create a client with basic information
const client = new Client(
{
name: "my-mcp-client",
version: "1.0.0"
},
{
capabilities: {
// Define your client capabilities
sampling: {}
}
}
);
// Connect to an MCP server
import { HTTPClientTransport } from '@zaptomcp/sdk/transports';
const transport = new HTTPClientTransport('http://localhost:3000');
await client.connect(transport);
// Read a resource
const resource = await client.readResource({
uri: "test://example/resource"
});
console.log(resource);
API Documentation
The SDK provides the following main exports:
Server: The main server classtransports: Various transport implementationsin-memory: In-memory transportsse: Server-Sent Events transportstdio: Standard I/O transportstreamable-http: HTTP transport with streaming support
Development
To work on the SDK:
# Navigate to the SDK package
cd packages/sdk
# Install dependencies
pnpm install
# Start development mode
pnpm dev
# Run tests
pnpm test
# Build the package
pnpm build
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch ( git checkout -b feature/amazing-feature )
- Commit your changes using conventional commits ( pnpm commit )
- Push to the branch ( git push origin feature/amazing-feature )
- Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
- ZapToMCP is an inspired porting of FastMCP
- Model Context Protocol Typescript SDK - The open standard this project implements
- FastMCP is inspired by the Python implementation by Jonathan Lowin.
- Parts of codebase were adopted from LiteMCP.
- Parts of codebase were adopted from Model Context protocolでSSEをやってみる.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.