mcp-吡啶
一个用于模型上下文协议 (MCP) 的 Pyodide 服务器实现。该服务器支持大型语言模型 (LLM) 通过 MCP 接口执行 Python 代码。
特征
使用 Pyodide 实现 LLM 的 Python 代码执行功能
符合 MCP 的服务器实现
支持 stdio 和 SSE 传输模式
用 TypeScript 编写的健壮实现
可用作命令行工具
安装
用法
作为服务器
作为命令行工具
以 stdio 模式启动(默认):
以 SSE 模式启动:
SSE模式
在 SSE 模式下运行时,服务器提供以下端点:
SSE 连接:
http://localhost:3020/sse消息处理程序:
http://localhost:3020/messages
客户端连接示例:
项目结构
依赖项
@modelcontextprotocol/sdk: MCP SDK (^1.4.0)pyodide:Python 运行环境(^0.27.1)arktype:类型验证库(^2.0.1)express:支持 SSE 的 Web 框架cors:用于 SSE 支持的 CORS 中间件
发展
要求
Node.js 18 或更高版本
npm 9 或更高版本
设置
脚本
npm run build:编译 TypeScript 并设置执行权限npm start:以 stdio 模式运行服务器npm run start:sse:以 SSE 模式运行服务器
环境变量
PYODIDE_CACHE_DIR:Pyodide 缓存目录(默认值:“./cache”)PYODIDE_DATA_DIR:挂载数据的目录(默认值:“./data”)PORT:SSE 服务器的端口(默认值:3020)
执照
麻省理工学院
贡献
分叉存储库
创建功能分支(
git checkout -b feature/amazing-feature)提交您的更改(
git commit -am 'Add some amazing feature')推送到分支(
git push origin feature/amazing-feature)创建拉取请求
重要提示
该项目正在开发中,API 可能会发生变化
在生产使用前进行彻底测试
出于安全原因,执行不受信任的代码时务必谨慎
使用 SSE 模式时,请确保根据需要正确配置 CORS
支持
请使用问题跟踪器来查找问题和疑问。
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
一个 Pyodide 服务器,用于通过模型上下文协议 (MCP) 由大型语言模型 (LLM) 执行 Python 代码。
Related Resources
Related MCP Servers
- -security-license-qualityA Python-based MCP server that allows Claude and other LLMs to execute arbitrary Python code directly through your desktop Claude app, enabling data scientists to connect LLMs to APIs and executable code.Last updated -26MIT License
- Asecurity-licenseAqualityA Model Context Protocol (MCP) server implementation for the Didlogic API. This server allows Large Language Models (LLMs) to interact with Didlogic services through a standardized interface.Last updated -221MIT License
- Asecurity-licenseAqualityA Model Context Protocol server that allows LLMs to interact with Python environments, execute code, and manage files within a specified working directory.Last updated -974
- -security-license-qualityA Python implementation of the Model Context Protocol that allows applications to provide standardized context for LLMs, enabling creation of servers that expose data and functionality to LLM applications through resources, tools, and prompts.Last updated -MIT License