发现优秀的 MCP 服务器
通过 MCP 服务器扩展您的代理能力,拥有 68,146 个能力。
Build
Okay, I can help you understand how to use the TypeScript SDK to create different MCP (Mesh Configuration Protocol) servers. However, I need a little more context to give you the *most* helpful answer. Specifically, tell me: 1. **Which MCP SDK are you using?** There are several possibilities, including: * **Istio's MCP SDK (likely part of the `envoyproxy/go-control-plane` project, but you'd be using the TypeScript bindings).** This is the most common use case if you're working with Istio or Envoy. * **A custom MCP implementation.** If you're building your own MCP server from scratch, you'll need to define your own data structures and server logic. * **Another MCP SDK.** There might be other, less common, MCP SDKs available. 2. **What kind of MCP server do you want to create?** What specific resources will it serve? For example: * **Route Configuration (RDS) server:** Serves route configurations to Envoy proxies. * **Cluster Configuration (CDS) server:** Serves cluster definitions to Envoy proxies. * **Listener Configuration (LDS) server:** Serves listener configurations to Envoy proxies. * **Endpoint Discovery Service (EDS) server:** Serves endpoint information to Envoy proxies. * **A custom resource server:** Serves your own custom resource types. 3. **What is your desired level of detail?** Do you want: * **A high-level overview of the process?** * **Example code snippets?** * **A complete, runnable example?** (This would be more complex and require more information from you.) **General Steps (Assuming Istio/Envoy MCP):** Here's a general outline of the steps involved in creating an MCP server using a TypeScript SDK (assuming it's based on the Envoy/Istio MCP protocol): 1. **Install the Necessary Packages:** You'll need to install the appropriate TypeScript packages. This will likely involve: * The core gRPC library for TypeScript (`@grpc/grpc-js` or similar). * The generated TypeScript code from the Protocol Buffers (`.proto`) definitions for the MCP resources you want to serve (e.g., `envoy.config.route.v3`, `envoy.config.cluster.v3`, etc.). You'll typically use `protoc` (the Protocol Buffer compiler) and a TypeScript plugin to generate these files. * Potentially, a library that provides helper functions for working with MCP. ```bash npm install @grpc/grpc-js google-protobuf # And potentially other packages depending on your setup ``` 2. **Generate TypeScript Code from Protocol Buffers:** You'll need to obtain the `.proto` files that define the MCP resources (e.g., from the `envoyproxy/go-control-plane` repository or your own custom definitions). Then, use `protoc` to generate TypeScript code from these files. This will create the TypeScript classes that represent the resource types. Example `protoc` command (you'll need to adjust this based on your `.proto` file locations and plugin configuration): ```bash protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=. your_mcp_resource.proto ``` 3. **Implement the gRPC Service:** Create a TypeScript class that implements the gRPC service defined in the `.proto` files. This class will have methods that correspond to the MCP endpoints (e.g., `StreamRoutes`, `StreamClusters`, etc.). These methods will receive requests from Envoy proxies and return the appropriate resource configurations. 4. **Handle the MCP Stream:** The core of an MCP server is handling the bidirectional gRPC stream. Your service implementation will need to: * Receive `DiscoveryRequest` messages from the client (Envoy proxy). * Process the request, determining which resources the client is requesting. * Fetch the appropriate resource configurations from your data store (e.g., a database, a configuration file, or in-memory data). * Construct `DiscoveryResponse` messages containing the resource configurations. * Send the `DiscoveryResponse` messages back to the client. * Handle errors and stream termination gracefully. 5. **Manage Resource Versions (Important for Updates):** MCP uses versioning to ensure that clients receive consistent updates. You'll need to track the versions of your resources and include them in the `DiscoveryResponse` messages. When a client sends a `DiscoveryRequest`, it will include the version of the resources it currently has. Your server should only send updates if the client's version is out of date. 6. **Implement a Data Store (Configuration Source):** You'll need a way to store and manage the resource configurations that your MCP server serves. This could be a simple configuration file, a database, or a more complex configuration management system. 7. **Start the gRPC Server:** Use the gRPC library to start a gRPC server and register your service implementation with it. The server will listen for incoming connections from Envoy proxies. 8. **Configure Envoy to Use Your MCP Server:** Configure your Envoy proxies to connect to your MCP server. This will typically involve specifying the server's address and port in the Envoy configuration. **Example (Conceptual - Requires Adaptation):** ```typescript // Assuming you've generated TypeScript code from your .proto files // import { RouteDiscoveryServiceService, RouteDiscoveryServiceHandlers } from './route_discovery_grpc_pb'; // import { DiscoveryRequest, DiscoveryResponse } from './discovery_pb'; import * as grpc from '@grpc/grpc-js'; // Replace with your actual generated code interface DiscoveryRequest { versionInfo: string; node: any; // Replace with your Node type resourceNames: string[]; typeUrl: string; responseNonce: string; errorDetail: any; // Replace with your Status type } interface DiscoveryResponse { versionInfo: string; resources: any[]; // Replace with your Resource type typeUrl: string; nonce: string; controlPlane: any; // Replace with your ControlPlane type } interface RouteDiscoveryServiceHandlers { streamRoutes: grpc.ServerDuplexStream<DiscoveryRequest, DiscoveryResponse>; } class RouteDiscoveryServiceImpl implements RouteDiscoveryServiceHandlers { streamRoutes(stream: grpc.ServerDuplexStream<DiscoveryRequest, DiscoveryResponse>): void { stream.on('data', (request: DiscoveryRequest) => { console.log('Received request:', request); // Fetch route configurations based on the request const routes = this.fetchRoutes(request); // Construct the DiscoveryResponse const response: DiscoveryResponse = { versionInfo: 'v1', // Replace with your versioning logic resources: routes, typeUrl: 'envoy.config.route.v3.RouteConfiguration', // Replace with your resource type URL nonce: 'some-nonce', // Generate a unique nonce controlPlane: null, // Replace if you have control plane info }; stream.write(response); }); stream.on('end', () => { console.log('Stream ended'); stream.end(); }); stream.on('error', (err) => { console.error('Stream error:', err); stream.end(); }); } private fetchRoutes(request: DiscoveryRequest): any[] { // Implement your logic to fetch route configurations // based on the request parameters (e.g., resourceNames, versionInfo) // This is where you would access your data store. console.log("fetching routes"); return [ { name: 'route1', domains: ['example.com'] }, { name: 'route2', domains: ['test.com'] }, ]; // Replace with actual route configurations } } function main() { const server = new grpc.Server(); // server.addService(RouteDiscoveryServiceService, new RouteDiscoveryServiceImpl()); server.addService({streamRoutes: {path: "/envoy.service.discovery.v3.RouteDiscoveryService/StreamRoutes", requestStream: true, responseStream: true, requestSerialize: (arg: any) => Buffer.from(JSON.stringify(arg)), requestDeserialize: (arg: Buffer) => JSON.parse(arg.toString()), responseSerialize: (arg: any) => Buffer.from(JSON.stringify(arg)), responseDeserialize: (arg: Buffer) => JSON.parse(arg.toString())}}, new RouteDiscoveryServiceImpl()); server.bindAsync('0.0.0.0:50051', grpc.ServerCredentials.createInsecure(), (err, port) => { if (err) { console.error('Failed to bind:', err); return; } console.log(`Server listening on port ${port}`); server.start(); }); } main(); ``` **Important Considerations:** * **Error Handling:** Implement robust error handling to gracefully handle unexpected situations. * **Logging:** Add logging to help you debug and monitor your MCP server. * **Security:** Secure your gRPC server using TLS/SSL. * **Scalability:** Consider the scalability of your MCP server, especially if you're serving a large number of Envoy proxies. * **Testing:** Thoroughly test your MCP server to ensure that it's working correctly. **Next Steps:** 1. **Tell me which MCP SDK you're using.** 2. **Tell me what kind of MCP server you want to create.** 3. **Tell me your desired level of detail.** Once I have this information, I can provide you with more specific and helpful guidance.
CT2 MCP Server
Centralizes multi-agent team workflows, providing Kanban, audit timeline, scorecards, and event hooks, integrated natively with Hermes Dashboard via the Model Context Protocol.
Prompt Bookmarks
Enables users to organize, search, and manage a shared library of prompts across AI tools via the Model Context Protocol. It supports hierarchical folder organization, tagging, and template variable substitution for dynamic prompt generation.
Whoop MCP Server
Connects Whoop health data to Claude via an MCP server, enabling retrieval of recovery, sleep, strain, and workout metrics through natural language tools.
PostgreSQL MCP Server
Enables LLMs to interact deeply with PostgreSQL databases—query data, manage schema, analyze performance, and administer the database.
mantis-mcp
Enables natural language interaction with MantisBT issues and notes via CRUD operations and semantic search.
GitHub MCP Server
Enables users to interact with GitHub via natural language requests, executing API calls and returning structured responses.
hive-exp
An MCP server enabling AI agents to record, query, and share structured problem-solving experiences with human review and confidence decay.
chrome-agent-mcp
Enables AI agents to fully control Google Chrome: navigate, click, fill forms, inspect DevTools, and manage tabs with parallel execution and session isolation.
@theyahia/voximplant-mcp
MCP server for Voximplant API enabling calls, SMS, recordings, scenarios, and rules management with 11 tools and 2 skills.
Task API MCP
Enables AI clients to create and manage tasks via a local REST API by converting natural language into HTTP requests through the Model Context Protocol.
FastMCP Demo Server
A production-ready MCP server that provides hackathon resources and reusable starter prompts. Built with FastMCP framework and includes comprehensive deployment options for development and production environments.
Arkana
An MCP server that provides 294 malware analysis tools behind an AI-driven interface, enabling natural language investigation of binaries.
mcp-units
MCP server for converting cooking measurements (volume, weight, temperature) between common units like ml, cup, g, oz, and Celsius/Fahrenheit.
@accos/mcp-server
Connects AI agents to ACCOS for OCR on Thai receipts, tax invoices, and withholding tax certificates via MCP.
GraphMemory-IDE
An AI-assisted, long-term memory system for IDEs, powered by Kuzu graph database. GraphMemory-IDE is an MCP server that provides semantic vector search, graph-based knowledge storage, and real-time analytics.
Fugle MCP Server
icloud-mcp
MCP server for iCloud integration, providing tools for managing calendars, contacts, and email.
Weather Israel MCP
Enables fetching weather forecasts for Israeli cities via browser automation with Playwright, no API needed.
Resend MCP Server
Enables sending emails via the Resend API from Claude, with tools for sending, checking delivery status, listing recent emails, and managing domains.
kef-mcp
MCP server for controlling KEF wireless speakers (LSX II, LS50 Wireless II, LS60) and playing Spotify on them via local network and Spotify Web API.
Mcp Servers Collection
已验证的 MCP 服务器和集成集合
Mirdan
Automatically enhances developer prompts with quality requirements, codebase context, and architectural patterns, then orchestrates other MCP servers to ensure AI coding assistants produce high-quality, structured code that follows best practices and security standards.
NannyKeeper MCP Server
Enables AI agents to calculate US household employer (nanny) taxes for all 50 states plus DC, including Social Security, Medicare, FUTA, and state unemployment, through natural language.
gemini-image-mcp
Enables Claude Code to generate and edit images using Google's Gemini and Imagen models on Vertex AI, with support for multiple models, aspect ratios, and image fusion.
Continuo Memory System
Enables persistent memory and semantic search for development workflows with hierarchical compression. Store and retrieve development knowledge across IDE sessions using natural language queries, circumventing context window limitations.
MCP Test Client
MCP 测试客户端是一个用于模型上下文协议 (MCP) 服务器的 TypeScript 测试实用程序。
AskHumanToWork MCP Server
Enables AI agents to capture, manage, and retrieve todos with due dates and provenance, while automatically escalating reminders until tasks are completed.
mcp-maritime
Provides real-time maritime weather data, tropical cyclone warnings, and route calculations for AI agents.
Android Puppeteer
Enables AI agents to interact with Android devices through visual UI element detection and automated interactions. Provides comprehensive Android automation capabilities including touch gestures, text input, screenshots, and video recording via uiautomator2.