Token导航 LogoToken导航TokenDH.com
Python SDK To MCP Converter logo
开发工具stdio官方级别未说明来源级核验

Python SDK To MCP Converter

MCP Server

将任何Python SDK转换为MCP服务器,自动发现方法并生成JSON模式,通过MCP协议暴露功能。适用于多种Python库和SDK,如Kubernetes、GitHub、Azure、AWS等。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
开发工具Python自动化

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

sarptandoven

提供方

sarptandoven

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

python sdk to mcp converter

converts any python sdk into an mcp server. discovers methods automatically, generates json schemas, exposes via mcp protocol.

tested on: kubernetes, github, azure, aws (boto3), stripe, requests, and standard python libraries.

quick start

pip install -r requirements.txt
cd demo_agent
cp .env.example .env
nano .env  # add OPENAI_API_KEY
python app.py

see SETUP.md for detailed instructions and credential configuration.

how it works

discovery: uses python inspect to find methods from any module. handles simple modules (os, json), client sdks (github, kubernetes), and azure operation groups.

schemas: converts function signatures to json schemas. extracts types from annotations and descriptions from docstrings.

protocol: implements json-rpc 2.0 over stdio. supports tools/list (discovery) and tools/call (execution).

execution: validates inputs, injects auth, executes with retries and timeout, caches results, redacts secrets.

llm usage: optional openai api calls during startup to enhance schema descriptions. disabled by default. core functionality works without it.

run the server directly

export SDKS="os,requests,kubernetes"
python server.py

reads json-rpc from stdin, writes responses to stdout.

configuration

environment variables for server behavior:

SDKS="os,boto3"              # which sdks to load
ALLOW_DANGEROUS=false        # filter delete/remove operations
ENABLE_CACHE=true            # cache results
MAX_RETRIES=3                # retry failed calls

sdk credentials in demo_agent/.env:

OPENAI_API_KEY=sk-...        # required for demo ui
GITHUB_TOKEN=ghp_...         # optional
AZURE_TENANT_ID=...          # optional
AWS_ACCESS_KEY_ID=...        # optional

testing

cd core_sdk_to_mcp_tool
python test_core_functionality.py

files

  • server.py - mcp server main loop
  • reflection.py - method discovery
  • schema_gen.py - json schema generation
  • executor.py - execution with retry/cache
  • mcp_protocol.py - json-rpc handlers
  • auth.py - credential injection
  • demo_agent/app.py - terminal ui demo

supported sdks

works with any python module. special handling for:

  • client sdks: instantiates with credentials (github, kubernetes)
  • azure: discovers operation groups (resource_groups, virtual_machines)
  • factory patterns: boto3, stripe

limitations

  • openai limits to 128 tools per agent
  • requires type hints for accurate schemas
  • authentication must be pre-configured

目录标签

目录标签

开发工具Python自动化PythonSDK转换本地部署JSON模式生成MCP协议自动化工具

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP