MCP cover image
See in Github
2025-04-14

Un Zap para construir servidores MCP

0

Github Watches

0

Github Forks

0

Github Stars

ZapToMCP

Valkeyrie

⚠️ 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.

GitHub package.json version node:20 pnpm@10.8.1 npm License: MIT TypeScript Biome

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 packages
  • pnpm build: Build all packages
  • pnpm clean: Clean build artifacts
  • pnpm lint: Run linting across all packages
  • pnpm format: Format code across all packages
  • pnpm typecheck: Run type checking across all packages
  • pnpm 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 class
  • transports: Various transport implementations
    • in-memory: In-memory transport
    • sse: Server-Sent Events transport
    • stdio: Standard I/O transport
    • streamable-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.

  1. Fork the repository
  2. Create your feature branch ( git checkout -b feature/amazing-feature )
  3. Commit your changes using conventional commits ( pnpm commit )
  4. Push to the branch ( git push origin feature/amazing-feature )
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

相关推荐

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Aurity Ltd
  • Create and Publish Business Websites in seconds. AI will gather all the details about your website and generate link to your website.

  • Convincible Ltd
  • You're in a stone cell – can you get out? A classic choose-your-adventure interactive fiction game, based on a meticulously-crafted playbook. With a medieval fantasy setting, infinite choices and outcomes, and dice!

  • John Rafferty
  • Text your favorite pet, after answering 10 questions about their everyday lives!

  • Ian O'Connell
  • Provide players' names or enter Quickstart to start the game!

  • analogchat.com
  • Efficient Spotify assistant for personalized music data.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llM 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Resumen de los mejores recursos del mundo.

  • langgenius
  • av
  • Ejecute sin esfuerzo LLM Backends, API, frontends y servicios con un solo comando.

  • alibaba
  • 1Panel-dev
  • 🔥 1Panel proporciona una interfaz web intuitiva y un servidor MCP para administrar sitios web, archivos, contenedores, bases de datos y LLM en un servidor de Linux.

  • Byaidu
  • Traducción de papel científico en PDF con formatos preservados - 基于 Ai 完整保留排版的 PDF 文档全文双语翻译 , 支持 支持 支持 支持 支持 支持 支持 支持 支持 支持 支持 支持 等服务 等服务 等服务 提供 提供 提供 提供 提供 提供 提供 提供 提供 提供 提供 提供 cli/mcp/docker/zotero

  • caio-moliveira
  • Este proyecto fue creado para demostrar cómo podemos conectarnos con diferentes protocolos de contexto del modelo (MCP).

  • microsoft
  • Python tool for converting files and office documents to Markdown.

  • mindsdb
  • AI's query engine - Platform for building AI that can answer questions over large scale federated data. - The only MCP Server you'll ever need

  • rulego
  • ⛓️Rulego es un marco de motor de regla de orquestación de componentes de alta generación de alto rendimiento, de alto rendimiento y de alto rendimiento para GO.

  • AstrBotDevs
  • ✨ 易上手的多平台 llm 聊天机器人及开发框架 ✨ 平台支持 qq 、 qq 频道、 telegram 、微信、企微、飞书 | MCP 服务器、 OpenAi 、 Deepseek 、 Géminis 、硅基流动、月之暗面、 Ollama 、 oneapi 、 DiFy 等。附带 Webui。

  • nbonamy
  • WITSY: Asistente de escritorio AI

    Reviews

    3 (2)
    Avatar
    user_jc21lJ7k
    2025-04-24

    I've been using zaptomcp for a while now, and it's been fantastic! Developed by hoghweed, this application truly stands out. The interface is intuitive, and the features are incredibly useful for managing my tasks efficiently. Highly recommended for anyone looking for a reliable MCP application.

    Avatar
    user_qxVkpwkB
    2025-04-24

    As a dedicated user of zaptomcp, I must say this tool by hoghweed has significantly streamlined my processes. Its intuitive design and robust functionality have made complex tasks much simpler. I highly recommend it to anyone looking for an efficient and reliable solution.