
mcp examples
包含模型上下文协议 (MCP) 的示例和实现,展示如何构建和使用 MCP 服务器与工具。
Repository Info
About This Server
包含模型上下文协议 (MCP) 的示例和实现,展示如何构建和使用 MCP 服务器与工具。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
MCP Examples
This repository contains examples and implementations for the Model Context Protocol (MCP). The examples are designed to demonstrate how to build and use MCP servers and tools effectively.
Repository Structure
The repository is organized as follows:
mcp-node-examples/
echo/
index.ts
package.json
tsconfig.json
mcp-node-examples/echo
This folder contains an example implementation of an MCP server using Node.js. The server includes a simple tool called echo_tool that echoes back the input provided by the client.
Files:
index.ts: The main entry point for the echo server implementation.package.json: Contains the dependencies and scripts for the Node.js project.tsconfig.json: TypeScript configuration file.
Getting Started
To run the examples in this repository, follow these steps:
-
Clone the repository:
git clone https://github.com/muhtalipdede/mcp-examples.git cd mcp-examples/mcp-node-examples/echo -
Install dependencies:
npm install -
Run the server:
npm start
Usage
The echo server listens for client connections and provides the following functionality:
echo_tool: Accepts a string input and returns the same string as output.
Example Request
{
"method": "callTool",
"params": {
"name": "echo_tool",
"arguments": {
"input": "Hello, MCP!"
}
},
"jsonrpc": "2.0",
"id": 1
}
Example Response
{
"result": {
"content": {
"type": "text",
"text": "Echo: Hello, MCP!"
},
"isError": false
},
"jsonrpc": "2.0",
"id": 1
}
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests to improve the examples or add new ones.
License
This repository is licensed under the MIT License. See the LICENSE file for details.
Quick Start
Clone the repository
git clone https://github.com/muhtalipdede/mcp-examplesInstall dependencies
cd mcp-examples
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.