Discover Awesome MCP Servers

Extend your agent with 16,005 capabilities via MCP servers.

All16,005
TG_MCP

TG_MCP

A lightweight Python interface that exposes TigerGraph database operations as structured tools and URI-based resources for Claude and other MCP agents.

Pagos Data MCP Server

Pagos Data MCP Server

Enables Claude to retrieve BIN (Bank Identification Number) data for payment cards, with options for basic or enhanced insights through the Pagos API.

Enrichment MCP Server

Enrichment MCP Server

A Model Context Protocol server that enables users to perform third-party enrichment lookups for security observables (IP addresses, domains, URLs, emails) through services like VirusTotal, Shodan, and others.

MCP Codebase Index

MCP Codebase Index

Enables semantic search across your codebase using Google's Gemini embeddings and Qdrant Cloud vector storage. Supports 15+ programming languages with smart code chunking and real-time file change monitoring.

QMT-MCP-Server

QMT-MCP-Server

镜子 (jìng zi)

MCP Web Extractor

MCP Web Extractor

使用 Readability.js 提取网页内容的 MCP 服务器。

MCP-server-using-python

MCP-server-using-python

我们正在构建一个本地 MCP 服务器,名为 mix_server,它能与 Claude 建立桌面连接,这样你就可以通过自然语言与你的工具进行交互。

MyFitnessPal MCP Server

MyFitnessPal MCP Server

Enables retrieval and analysis of MyFitnessPal nutrition data including daily summaries, meal breakdowns, exercise tracking, and macro/micronutrient analysis. Uses browser cookie authentication to access your personal MyFitnessPal account data through natural language queries.

YouTube Knowledge MCP

YouTube Knowledge MCP

Transforms YouTube into a queryable knowledge source with search, video details, transcript analysis, and AI-powered tools for summaries, learning paths, and knowledge graphs. Features quota-aware API access with caching and optional OpenAI/Anthropic integration for advanced content analysis.

Playwright Testing Framework

Playwright Testing Framework

使用 Playwright 和 Cursor MCP 服务器的 AI 驱动的测试自动化

Cloudflare Remote MCP Server Template

Cloudflare Remote MCP Server Template

A template for deploying MCP servers on Cloudflare Workers without authentication. Enables easy creation and deployment of custom MCP tools that can be accessed remotely via Claude Desktop or Cloudflare AI Playground.

rest-to-mcp

rest-to-mcp

好的,这是一个将 REST API 转换为 MCP 服务器的教程项目: **项目目标:** * 创建一个 MCP 服务器,该服务器可以接收来自客户端的请求。 * 将接收到的请求转换为对现有 REST API 的调用。 * 将 REST API 的响应转换回 MCP 响应并发送回客户端。 **技术栈:** * **MCP (Minecraft Protocol):** 理解 Minecraft 协议是关键。你需要了解数据包的结构和如何发送/接收它们。 * **Java (或你熟悉的语言):** Java 是 Minecraft 服务器开发的常用语言,但你也可以使用其他语言,只要它们支持网络编程和 JSON 处理。 * **Netty (或类似的网络库):** Netty 是一个高性能的网络应用程序框架,可以简化网络编程。 * **JSON 处理库 (Gson, Jackson, etc.):** 用于序列化和反序列化 JSON 数据。 * **HTTP 客户端库 (HttpClient, OkHttp, etc.):** 用于调用 REST API。 **项目步骤:** 1. **环境搭建:** * 安装 Java Development Kit (JDK)。 * 安装一个 IDE (例如 IntelliJ IDEA 或 Eclipse)。 * 创建一个新的 Java 项目。 * 添加 Netty、JSON 处理库和 HTTP 客户端库作为项目依赖。 (使用 Maven 或 Gradle 管理依赖) 2. **理解 Minecraft 协议:** * **研究 Minecraft 协议:** 了解客户端和服务器之间如何通信。 你可以参考以下资源: * [Wiki.vg](https://wiki.vg/Protocol) (非常详细的协议文档) * [MCProtocolLib](https://github.com/Steveice112/MCProtocolLib) (一个 Java 库,可以帮助你处理 Minecraft 协议) * **确定要支持的协议版本:** 不同的 Minecraft 版本使用不同的协议。选择一个你想要支持的版本。 * **分析需要拦截的数据包:** 确定哪些客户端数据包需要被拦截并转换为 REST API 调用。 例如,聊天消息、命令、物品使用等。 * **分析需要发送的数据包:** 确定哪些服务器数据包需要被发送回客户端,以及如何将 REST API 的响应转换为这些数据包。 3. **创建 MCP 服务器:** * **使用 Netty 创建一个 TCP 服务器:** 监听指定的端口 (例如 25565,Minecraft 的默认端口)。 * **实现一个 ChannelHandler:** 这个 handler 将处理客户端连接、接收数据包、发送数据包和处理错误。 * **处理握手 (Handshake) 数据包:** 客户端首先发送一个握手数据包,其中包含协议版本、服务器地址和端口。 你需要解析这个数据包并验证协议版本。 * **处理登录 (Login) 数据包:** 客户端发送登录数据包,其中包含玩家的用户名。 你需要验证用户名并发送登录成功数据包。 4. **拦截和转换数据包:** * **拦截客户端数据包:** 在 ChannelHandler 中,拦截你想要处理的客户端数据包。 * **解析数据包内容:** 根据协议文档,解析数据包中的数据。 * **将数据转换为 REST API 请求:** 将解析后的数据转换为一个 HTTP 请求,并发送到你的 REST API。 例如,如果客户端发送了一个聊天消息,你可以将消息内容发送到 REST API 的一个端点。 * **处理 REST API 响应:** 接收 REST API 的响应。 * **将 REST API 响应转换为 MCP 数据包:** 将 REST API 的响应转换为一个或多个 MCP 数据包,并发送回客户端。 例如,如果 REST API 返回一个自定义的聊天消息,你可以将其转换为一个聊天消息数据包并发送回客户端。 5. **调用 REST API:** * **使用 HTTP 客户端库发送 HTTP 请求:** 使用你选择的 HTTP 客户端库 (例如 HttpClient 或 OkHttp) 发送 HTTP 请求到你的 REST API。 * **处理 HTTP 响应:** 接收 HTTP 响应并解析响应内容。 6. **错误处理:** * **处理网络错误:** 处理连接错误、超时错误等。 * **处理协议错误:** 处理无效的数据包、错误的协议版本等。 * **处理 REST API 错误:** 处理 REST API 返回的错误。 * **向客户端发送错误消息:** 如果发生错误,向客户端发送一个错误消息。 7. **测试:** * **使用 Minecraft 客户端连接到你的 MCP 服务器:** 确保你的 Minecraft 客户端使用与你的服务器相同的协议版本。 * **测试所有功能:** 测试所有你想要支持的功能,例如聊天消息、命令、物品使用等。 * **调试错误:** 如果出现错误,使用调试器来查找问题并修复它们。 **代码示例 (简化版,仅供参考):** ```java import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.*; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.handler.codec.ByteToMessageDecoder; import io.netty.handler.codec.MessageToByteEncoder; import io.netty.buffer.ByteBuf; import java.util.List; public class McpServer { public static void main(String[] args) throws Exception { EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup(); try { ServerBootstrap b = new ServerBootstrap(); b.group(bossGroup, workerGroup) .channel(NioServerSocketChannel.class) .childHandler(new ChannelInitializer<SocketChannel>() { @Override public void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast( new PacketDecoder(), new PacketEncoder(), new McpServerHandler() ); } }) .option(ChannelOption.SO_BACKLOG, 128) .childOption(ChannelOption.SO_KEEPALIVE, true); ChannelFuture f = b.bind(25565).sync(); System.out.println("MCP Server started on port 25565"); f.channel().closeFuture().sync(); } finally { workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); } } // 示例:数据包解码器 static class PacketDecoder extends ByteToMessageDecoder { @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { // 读取数据包长度 (VarInt) int packetLength = readVarInt(in); // 确保有足够的数据 if (in.readableBytes() < packetLength) { in.resetReaderIndex(); // 重置读取索引,等待更多数据 return; } // 读取数据包 ID (VarInt) int packetId = readVarInt(in); // 读取数据包内容 ByteBuf packetData = in.readBytes(packetLength - varIntLength(packetId)); // 创建一个数据包对象 (你需要定义你的数据包类) Packet packet = new Packet(packetId, packetData); out.add(packet); } // 读取 VarInt (Minecraft 使用的变长整数) private int readVarInt(ByteBuf in) { int numRead = 0; int result = 0; byte read; do { read = in.readByte(); int value = (read & 0x7f); result |= (value << (7 * numRead)); numRead++; if (numRead > 5) { throw new RuntimeException("VarInt is too big"); } } while ((read & 0x80) != 0); return result; } // 计算 VarInt 的长度 private int varIntLength(int value) { int length = 0; do { value >>>= 7; length++; } while (value != 0); return length; } } // 示例:数据包编码器 static class PacketEncoder extends MessageToByteEncoder<Packet> { @Override protected void encode(ChannelHandlerContext ctx, Packet msg, ByteBuf out) throws Exception { ByteBuf packetData = msg.getData(); int packetId = msg.getId(); // 计算数据包长度 int packetLength = varIntLength(packetId) + packetData.readableBytes(); // 写入数据包长度 (VarInt) writeVarInt(out, packetLength); // 写入数据包 ID (VarInt) writeVarInt(out, packetId); // 写入数据包内容 out.writeBytes(packetData); } // 写入 VarInt private void writeVarInt(ByteBuf out, int value) { while (true) { if ((value & ~0x7F) == 0) { out.writeByte(value); return; } out.writeByte((value & 0x7F) | 0x80); value >>>= 7; } } // 计算 VarInt 的长度 private int varIntLength(int value) { int length = 0; do { value >>>= 7; length++; } while (value != 0); return length; } } // 示例:服务器处理器 static class McpServerHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { Packet packet = (Packet) msg; int packetId = packet.getId(); ByteBuf packetData = packet.getData(); System.out.println("Received packet with ID: " + packetId); // 根据数据包 ID 处理数据包 switch (packetId) { case 0x00: // Handshake handleHandshake(ctx, packetData); break; case 0x00: // Login Start handleLoginStart(ctx, packetData); break; // 其他数据包处理 default: System.out.println("Unknown packet ID: " + packetId); break; } } private void handleHandshake(ChannelHandlerContext ctx, ByteBuf packetData) { // 解析握手数据包 int protocolVersion = readVarInt(packetData); String serverAddress = readString(packetData); int serverPort = packetData.readUnsignedShort(); int nextState = readVarInt(packetData); System.out.println("Handshake received: protocolVersion=" + protocolVersion + ", serverAddress=" + serverAddress + ", serverPort=" + serverPort + ", nextState=" + nextState); // 根据 nextState 进行处理 (例如,切换到状态 1 - Status 或 2 - Login) if (nextState == 1) { // 发送 Status Response sendStatusResponse(ctx); } else if (nextState == 2) { // 准备处理 Login } } private void handleLoginStart(ChannelHandlerContext ctx, ByteBuf packetData) { // 解析登录开始数据包 String username = readString(packetData); System.out.println("Login Start received: username=" + username); // TODO: 调用 REST API 进行身份验证 // 发送 Login Success 数据包 sendLoginSuccess(ctx, username); } private void sendStatusResponse(ChannelHandlerContext ctx) { // 创建 Status Response 数据包 String jsonResponse = "{\"version\": {\"name\": \"My MCP Server\", \"protocol\": 754}, \"players\": {\"max\": 100, \"online\": 0}, \"description\": {\"text\": \"A custom MCP server\"}}"; ByteBuf responseData = ctx.alloc().buffer(); writeString(responseData, jsonResponse); // 创建数据包 Packet statusResponsePacket = new Packet(0x00, responseData); // 发送数据包 ctx.writeAndFlush(statusResponsePacket); } private void sendLoginSuccess(ChannelHandlerContext ctx, String username) { // 创建 Login Success 数据包 ByteBuf responseData = ctx.alloc().buffer(); writeString(responseData, "00000000-0000-0000-0000-000000000000"); // UUID (可以生成一个) writeString(responseData, username); // 创建数据包 Packet loginSuccessPacket = new Packet(0x02, responseData); // 发送数据包 ctx.writeAndFlush(loginSuccessPacket); } // 读取 VarInt private int readVarInt(ByteBuf in) { int numRead = 0; int result = 0; byte read; do { read = in.readByte(); int value = (read & 0x7f); result |= (value << (7 * numRead)); numRead++; if (numRead > 5) { throw new RuntimeException("VarInt is too big"); } } while ((read & 0x80) != 0); return result; } // 写入 VarInt private void writeVarInt(ByteBuf out, int value) { while (true) { if ((value & ~0x7F) == 0) { out.writeByte(value); return; } out.writeByte((value & 0x7F) | 0x80); value >>>= 7; } } // 读取字符串 private String readString(ByteBuf in) { int length = readVarInt(in); ByteBuf stringData = in.readBytes(length); return stringData.toString(java.nio.charset.StandardCharsets.UTF_8); } // 写入字符串 private void writeString(ByteBuf out, String value) { byte[] stringBytes = value.getBytes(java.nio.charset.StandardCharsets.UTF_8); writeVarInt(out, stringBytes.length); out.writeBytes(stringBytes); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { cause.printStackTrace(); ctx.close(); } } // 数据包类 static class Packet { private final int id; private final ByteBuf data; public Packet(int id, ByteBuf data) { this.id = id; this.data = data; } public int getId() { return id; } public ByteBuf getData() { return data; } } } ``` **重要提示:** * **安全性:** 确保你的 REST API 是安全的,并且只允许授权的客户端访问。 使用身份验证和授权机制。 * **性能:** 优化你的代码以获得最佳性能。 使用缓存、连接池等技术。 * **可扩展性:** 设计你的服务器以支持大量的并发连接。 使用异步编程和非阻塞 I/O。 * **错误处理:** 实现完善的错误处理机制,以便在出现问题时能够快速诊断和修复。 * **协议版本:** 密切关注 Minecraft 协议的更新,并及时更新你的服务器以支持最新的协议版本。 * **代码组织:** 将你的代码组织成模块化的组件,以便于维护和扩展。 **下一步:** 1. **创建你的 REST API:** 如果你还没有 REST API,你需要创建一个。 你可以使用任何你喜欢的编程语言和框架。 2. **实现数据包处理逻辑:** 根据你的 REST API 的需求,实现数据包处理逻辑。 3. **测试你的服务器:** 使用 Minecraft 客户端连接到你的服务器并测试所有功能。 这是一个复杂的项目,需要对 Minecraft 协议和网络编程有深入的了解。 祝你成功! **中文翻译:** 好的,这是一个将 REST API 转换为 MCP 服务器的教程项目: **项目目标:** * 创建一个 MCP 服务器,该服务器可以接收来自客户端的请求。 * 将接收到的请求转换为对现有 REST API 的调用。 * 将 REST API 的响应转换回 MCP 响应并发送回客户端。 **技术栈:** * **MCP (Minecraft 协议):** 理解 Minecraft 协议是关键。你需要了解数据包的结构和如何发送/接收它们。 * **Java (或你熟悉的语言):** Java 是 Minecraft 服务器开发的常用语言,但你也可以使用其他语言,只要它们支持网络编程和 JSON 处理。 * **Netty (或类似的網絡庫):** Netty 是一个高性能的网络应用程序框架,可以简化网络编程。 * **JSON 处理库 (Gson, Jackson, etc.):** 用于序列化和反序列化 JSON 数据。 * **HTTP 客户端库 (HttpClient, OkHttp, etc.):** 用于调用 REST API。 **项目步骤:** 1. **环境搭建:** * 安装 Java Development Kit (JDK)。 * 安装一个 IDE (例如 IntelliJ IDEA 或 Eclipse)。 * 创建一个新的 Java 项目。 * 添加 Netty、JSON 处理库和 HTTP 客户端库作为项目依赖。 (使用 Maven 或 Gradle 管理依赖) 2. **理解 Minecraft 协议:** * **研究 Minecraft 协议:** 了解客户端和服务器之间如何通信。 你可以参考以下资源: * [Wiki.vg](https://wiki.vg/Protocol) (非常详细的协议文档) * [MCProtocolLib](https://github.com/Steveice112/MCProtocolLib) (一个 Java 库,可以帮助你处理 Minecraft 协议) * **确定要支持的协议版本:** 不同的 Minecraft 版本使用不同的协议。选择一个你想要支持的版本。 * **分析需要拦截的数据包:** 确定哪些客户端数据包需要被拦截并转换为 REST API 调用。 例如,聊天消息、命令、物品使用等。 * **分析需要发送的数据包:** 确定哪些服务器数据包需要被发送回客户端,以及如何将 REST API 的响应转换为这些数据包。 3. **创建 MCP 服务器:** * **使用 Netty 创建一个 TCP 服务器:** 监听指定的端口 (例如 25565,Minecraft 的默认端口)。 * **实现一个 ChannelHandler:** 这个 handler 将处理客户端连接、接收数据包、发送数据包和处理错误。 * **处理握手 (Handshake) 数据包:** 客户端首先发送一个握手数据包,其中包含协议版本、服务器地址和端口。 你需要解析这个数据包并验证协议版本。 * **处理登录 (Login) 数据包:** 客户端发送登录数据包,其中包含玩家的用户名。 你需要验证用户名并发送登录成功数据包。 4. **拦截和转换数据包:** * **拦截客户端数据包:** 在 ChannelHandler 中,拦截你想要处理的客户端数据包。 * **解析数据包内容:** 根据协议文档,解析数据包中的数据。 * **将数据转换为 REST API 请求:** 将解析后的数据转换为一个 HTTP 请求,并发送到你的 REST API。 例如,如果客户端发送了一个聊天消息,你可以将消息内容发送到 REST API 的一个端点。 * **处理 REST API 响应:** 接收 REST API 的响应。 * **将 REST API 响应转换为 MCP 数据包:** 将 REST API 的响应转换为一个或多个 MCP 数据包,并发送回客户端。 例如,如果 REST API 返回一个自定义的聊天消息,你可以将其转换为一个聊天消息数据包并发送回客户端。 5. **调用 REST API:** * **使用 HTTP 客户端库发送 HTTP 请求:** 使用你选择的 HTTP 客户端库 (例如 HttpClient 或 OkHttp) 发送 HTTP 请求到你的 REST API。 * **处理 HTTP 响应:** 接收 HTTP 响应并解析响应内容。 6. **错误处理:** * **处理网络错误:** 处理连接错误、超时错误等。 * **处理协议错误:** 处理无效的数据包、错误的协议版本等。 * **处理 REST API 错误:** 处理 REST API 返回的错误。 * **向客户端发送错误消息:** 如果发生错误,向客户端发送一个错误消息。 7. **测试:** * **使用 Minecraft 客户端连接到你的 MCP 服务器:** 确保你的 Minecraft 客户端使用与你的服务器相同的协议版本。 * **测试所有功能:** 测试所有你想要支持的功能,例如聊天消息、命令、物品使用等。 * **调试错误:** 如果出现错误,使用调试器来查找问题并修复它们。 **代码示例 (简化版,仅供参考):** ```java import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.*; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.handler.codec.ByteToMessageDecoder; import io.netty.handler.codec.MessageToByteEncoder; import io.netty.buffer.ByteBuf; import java.util.List; public class McpServer { public static void main(String[] args) throws Exception { EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup(); try { ServerBootstrap b = new ServerBootstrap(); b.group(bossGroup, workerGroup) .channel(NioServerSocketChannel.class) .childHandler(new ChannelInitializer<SocketChannel>() { @Override public void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast( new PacketDecoder(), new PacketEncoder(), new McpServerHandler() ); } }) .option(ChannelOption.SO_BACKLOG, 128) .childOption(ChannelOption.SO_KEEPALIVE, true); ChannelFuture f = b.bind(25565).sync(); System.out.println("MCP Server started on port 25565"); f.channel().closeFuture().sync(); } finally { workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); } } // 示例:数据包解码器 static class PacketDecoder extends ByteToMessageDecoder { @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { // 读取数据包长度 (VarInt) int packetLength = readVarInt(in); // 确保有足够的数据 if (in.readableBytes() < packetLength) { in.resetReaderIndex(); // 重置读取索引,等待更多数据 return; } // 读取数据包 ID (VarInt) int packetId = readVarInt(in); // 读取数据包内容 ByteBuf packetData = in.readBytes(packetLength - varIntLength(packetId)); // 创建一个数据包对象 (你需要定义你的数据包类) Packet packet = new Packet(packetId, packetData); out.add(packet); } // 读取 VarInt (Minecraft 使用的变长整数) private int readVarInt(ByteBuf in) { int numRead = 0; int result = 0; byte read; do { read = in.readByte(); int value = (read & 0x7f); result |= (value << (7 * numRead)); numRead++; if (numRead > 5) { throw new RuntimeException("VarInt is too big"); } } while ((read & 0x80) != 0); return result; } // 计算 VarInt 的长度 private int varIntLength(int value) { int length = 0; do { value >>>= 7; length++; } while (value != 0); return length; } } // 示例:数据包编码器 static class PacketEncoder extends MessageToByteEncoder<Packet> { @Override protected void encode(ChannelHandlerContext ctx, Packet msg, ByteBuf out) throws Exception { ByteBuf packetData = msg.getData(); int packetId = msg.getId(); // 计算数据包长度 int packetLength = varIntLength(packetId) + packetData.readableBytes(); // 写入数据包长度 (VarInt) writeVarInt(out, packetLength); // 写入数据包 ID (VarInt) writeVarInt(out, packetId); // 写入数据包内容 out.writeBytes(packetData); } // 写入 VarInt private void writeVarInt(ByteBuf out, int value) { while (true) { if ((value & ~0x7F) == 0) { out.writeByte(value); return; } out.writeByte((value & 0x7F) | 0x80); value >>>= 7; } } // 计算 VarInt 的长度 private int varIntLength(int value) { int length = 0; do { value >>>= 7; length++; } while (value != 0); return length; } } // 示例:服务器处理器 static class McpServerHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { Packet packet = (Packet) msg; int packetId = packet.getId(); ByteBuf packetData = packet.getData(); System.out.println("Received packet with ID: " + packetId); // 根据数据包 ID 处理数据包 switch (packetId) { case 0x00: // Handshake handleHandshake(ctx, packetData); break; case 0x00: // Login Start handleLoginStart(ctx, packetData); break; // 其他数据包处理 default: System.out.println("Unknown packet ID: " + packetId); break; } } private void handleHandshake(ChannelHandlerContext ctx, ByteBuf packetData) { // 解析握手数据包 int protocolVersion = readVarInt(packetData); String serverAddress = readString(packetData); int serverPort = packetData.readUnsignedShort(); int nextState = readVarInt(packetData); System.out.println("Handshake received: protocolVersion=" + protocolVersion + ", serverAddress=" + serverAddress + ", serverPort=" + serverPort + ", nextState=" + nextState); // 根据 nextState 进行处理 (例如,切换到状态 1 - Status 或 2 - Login) if (nextState == 1) { // 发送 Status Response sendStatusResponse(ctx); } else if (nextState == 2) { // 准备处理 Login } } private void handleLoginStart(ChannelHandlerContext ctx, ByteBuf packetData) { // 解析登录开始数据包 String username = readString(packetData); System.out.println("Login Start received: username=" + username); // TODO: 调用 REST API 进行身份验证 // 发送 Login Success 数据包 sendLoginSuccess(ctx, username); } private void sendStatusResponse(ChannelHandlerContext ctx) { // 创建 Status Response 数据包 String jsonResponse = "{\"version\": {\"name\": \"My MCP Server\", \"protocol\": 754}, \"players\": {\"max\": 100, \"online\": 0}, \"description\": {\"text\": \"A custom MCP server\"}}"; ByteBuf responseData = ctx.alloc().buffer(); writeString(responseData, jsonResponse); // 创建数据包 Packet statusResponsePacket = new Packet(0x00, responseData); // 发送数据包 ctx.writeAndFlush(statusResponsePacket); } private void sendLoginSuccess(ChannelHandlerContext ctx, String username) { // 创建 Login Success 数据包 ByteBuf responseData = ctx.alloc().buffer(); writeString(responseData, "00000000-0000-0000-0000-000000000000"); // UUID (可以生成一个) writeString(responseData, username); // 创建数据包 Packet loginSuccessPacket = new Packet(0x02, responseData); // 发送数据包 ctx.writeAndFlush(loginSuccessPacket); } // 读取 VarInt private int readVarInt(ByteBuf in) { int numRead = 0; int result = 0; byte read; do { read = in.readByte(); int value = (read & 0x7f); result |= (value << (7 * numRead)); numRead++; if (numRead > 5) { throw new RuntimeException("VarInt is too big"); } } while ((read & 0x80) != 0); return result; } // 写入 VarInt private void writeVarInt(ByteBuf out, int value) { while (true) { if ((value & ~0x7F) == 0) { out.writeByte(value); return; } out.writeByte((value & 0x7F) | 0x80); value >>>= 7; } } // 读取字符串 private String readString(ByteBuf in) { int length = readVarInt(in); ByteBuf stringData = in.readBytes(length); return stringData.toString(java.nio.charset.StandardCharsets.UTF_8); } // 写入字符串 private void writeString(ByteBuf out, String value) { byte[] stringBytes = value.getBytes(java.nio.charset.StandardCharsets.UTF_8); writeVarInt(out, stringBytes.length); out.writeBytes(stringBytes); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { cause.printStackTrace(); ctx.close(); } } // 数据包类 static class Packet { private final int id; private final ByteBuf data; public Packet(int id, ByteBuf data) { this.id = id; this.data = data; } public int getId() { return id; } public ByteBuf getData() { return data; } } } ``` **重要提示:** * **安全性:** 确保你的 REST API 是安全的,并且只允许授权的客户端访问。 使用身份验证和授权机制。 * **性能:** 优化你的代码以获得最佳性能。 使用缓存、连接池等技术。 * **可扩展性:** 设计你的服务器以支持大量的并发连接。 使用异步编程和非阻塞 I/O。 * **错误处理:** 实现完善的错误处理机制,以便在出现问题时能够快速诊断和修复。 * **协议版本:** 密切关注 Minecraft 协议的更新,并及时更新你的服务器以支持最新的协议版本。 * **代码组织:** 将你的代码组织成模块化的组件,以便于维护和扩展。 **下一步:** 1. **创建你的 REST API:** 如果你还没有 REST API,你需要创建一个。 你可以使用任何你喜欢的编程语言和框架。 2. **实现数据包处理逻辑:** 根据你的 REST API 的需求,实现数据包处理逻辑。 3. **测试你的服务器:** 使用 Minecraft 客户端连接到你的服务器并测试所有功能。 这是一个复杂的项目,需要对 Minecraft 协议和网络编程有深入的了解。 祝你成功!

🚀 GitLab MR MCP

🚀 GitLab MR MCP

与 GitLab 仓库无缝交互,轻松管理合并请求和问题。获取详细信息、添加评论,并简化您的代码审查流程。

Awesome MCP Security

Awesome MCP Security

Okay, here's a translation of "Security Threats related with MCP (Model Context Protocol), MCP Servers and more" into Chinese, along with some expanded explanations of the potential security threats to help you understand the context better: **Translation:** **中文 (Chinese):** 与 MCP (模型上下文协议)、MCP 服务器及相关内容相关的安全威胁 **Explanation of Potential Security Threats (to help with understanding and context):** To fully understand the security threats, it's important to consider what MCP is and how it's used. Since "Model Context Protocol" isn't a widely known or standardized term, I'll assume it refers to a protocol used to share context or data related to machine learning models. Based on that assumption, here are some potential security threats: * **Data Poisoning:** * **中文 (Chinese):** 数据投毒 (Shùjù tóudú) * **Explanation:** If an attacker can inject malicious data into the MCP server or the data used to train or evaluate the models, they can corrupt the models' behavior. This could lead to the model making incorrect predictions or decisions, potentially causing harm. * **Model Inversion Attacks:** * **中文 (Chinese):** 模型反演攻击 (Móxíng fǎnyǎn gōngjí) * **Explanation:** An attacker might try to reconstruct sensitive training data by querying the model through the MCP server. If the model reveals too much information about the training data, it could compromise privacy. * **Model Extraction Attacks:** * **中文 (Chinese):** 模型提取攻击 (Móxíng tíqǔ gōngjí) * **Explanation:** An attacker could try to create a copy of the model by observing its behavior through the MCP server. This is especially concerning if the model is proprietary or contains valuable intellectual property. * **Denial of Service (DoS) Attacks:** * **中文 (Chinese):** 拒绝服务攻击 (Jùjué fúwù gōngjí) * **Explanation:** An attacker could flood the MCP server with requests, making it unavailable to legitimate users. * **Unauthorized Access:** * **中文 (Chinese):** 未授权访问 (Wèi shòuquán fǎngwèn) * **Explanation:** If the MCP server is not properly secured, unauthorized users could gain access to sensitive data or models. This could involve exploiting vulnerabilities in the server software or using stolen credentials. * **Man-in-the-Middle (MitM) Attacks:** * **中文 (Chinese):** 中间人攻击 (Zhōngjiān rén gōngjí) * **Explanation:** An attacker could intercept communication between clients and the MCP server, potentially eavesdropping on sensitive data or modifying requests and responses. * **Vulnerabilities in MCP Server Software:** * **中文 (Chinese):** MCP 服务器软件中的漏洞 (MCP fúwùqì ruǎnjiàn zhōng de lòudòng) * **Explanation:** The MCP server software itself might contain security vulnerabilities that attackers could exploit to gain control of the server or access sensitive data. * **Injection Attacks (e.g., SQL Injection, Command Injection):** * **中文 (Chinese):** 注入攻击 (Zhùrù gōngjí) (例如,SQL 注入,命令注入) * **Explanation:** If the MCP server uses user-supplied input without proper sanitization, attackers could inject malicious code into the server's database queries or operating system commands. * **Authentication and Authorization Issues:** * **中文 (Chinese):** 身份验证和授权问题 (Shēnfèn yànzhèng hé shòuquán wèntí) * **Explanation:** Weak authentication mechanisms or flawed authorization policies could allow unauthorized users to access or modify data and models. **In summary, the security threats related to MCP, MCP servers, and related content are diverse and depend heavily on the specific implementation and use case. It's crucial to implement robust security measures to protect against these threats.** If you can provide more details about the specific context of MCP in your situation, I can provide a more tailored and accurate translation and explanation.

Docs-MCP

Docs-MCP

An MCP server that allows users to efficiently search and reference user-configured documents through document listing, grep searching, semantic searching with OpenAI Embeddings, and full document retrieval.

BigBugAI MCP Server

BigBugAI MCP Server

Enables access to BigBugAI cryptocurrency tools for getting trending tokens and performing token analysis by contract address. Provides production-ready API access with rate limiting and authentication for crypto market intelligence.

FreeCAD MCP

FreeCAD MCP

Enables control of FreeCAD CAD software from Claude Desktop through natural language commands. Supports creating, editing, and managing 3D objects, executing Python code, and generating screenshots of designs.

Skillz MCP Server

Skillz MCP Server

Enables LLMs to dynamically discover and execute tools through a structured skills system. Serves as a documentation hub where skills are defined in directories, allowing progressive loading and interpretation of capabilities.

revenuebase-mcp-server

revenuebase-mcp-server

revenuebase-mcp-server

MCPRepository

MCPRepository

开源的 ModelContextProtocol (MCP) 服务器仓库

Hashcat MCP Server

Hashcat MCP Server

A Model Context Protocol server that provides intelligent hashcat integration for Claude Desktop, allowing users to crack hashes, analyze passwords, and perform security assessments directly from Claude conversations.

akhq-mcp-server

akhq-mcp-server

用于 Kafka 监控工具 AKHQ 的实验性模型上下文协议服务器

MCP AgentRun Server

MCP AgentRun Server

Enables safe Python code execution in isolated Docker containers through the AgentRun framework. Provides automatic container lifecycle management and comprehensive error handling for secure and reproducible code execution.

MCP Dust Server

MCP Dust Server

镜子 (jìng zi)

ActiveCampaign MCP Server by CData

ActiveCampaign MCP Server by CData

This project builds a read-only MCP server. For full read, write, update, delete, and action capabilities and a simplified setup, check out our free CData MCP Server for ActiveCampaign (beta): https://www.cdata.com/download/download.aspx?sku=JUZK-V&type=beta

GitLab WeChat MCP

GitLab WeChat MCP

Enables users to retrieve GitLab commit records and automatically generate daily work reports that can be sent to WeChat Work groups. Supports querying commits by date and user, with seamless enterprise messaging integration.

GitHub-Jira MCP Server

GitHub-Jira MCP Server

Enables secure integration between GitHub and Jira with permission controls, allowing users to manage repositories, create issues and pull requests, and handle Jira project workflows through natural language. Supports OAuth authentication and comprehensive security enforcement for both platforms.

LoreKeeper MCP

LoreKeeper MCP

Provides fast, cached access to comprehensive Dungeons & Dragons 5th Edition data including spells, monsters, classes, races, equipment, and rules through Open5e and D\&D 5e APIs.

Polymarket MCP Tool

Polymarket MCP Tool

A Model Context Protocol server that enables interaction with Polymarket prediction markets through Claude Desktop.

Databricks MCP Server Template

Databricks MCP Server Template

Enables AI assistants like Claude to interact with Databricks workspaces through a secure, authenticated interface. Supports custom prompts and tools that leverage the Databricks SDK for workspace management, job execution, and SQL operations.