JM

jnanasrota/mcpgen

API development

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

21 stars 2 forks 품질 75 트렌드 4MIT

OpenAPI spec 또는 Postman 컬렉션을 30 초 안에 자체 Python MCP 서버로 설정하십시오

개요

OpenAPI spec 또는 Postman 수집에 점 mcpgen. mcpgen, no proxy, no lock-in에 runtime Dependency가 없습니다. 다운로드 수정하기 배송하기 그게 다. mcpgen은 spec을 읽고 Python MCP 서버를 디스크로 작성합니다. 자체 유지 디렉토리 소스 코드와 함께: 까만 상자 없음. 런타임에 의존하지 않습니다. 그냥 파이썬. mcpgen은 claude desktop config.json에 붙여넣기 위해 정확한 구성 스니펫을 인쇄합니다. - macOS: ~/Library/Application Support/Claude/claude desktop config.json - Windows: %APPDATA%\Claude\claude desktop config.json 대부분의 API-to-MCP 도구는 - 그들은 Claude와 API를 영원히 앉아, 당신은 실행에 따라 달라집니다. mcpgen는 생성합니다. 출력은 일반 파이썬 파일입니다. 당신은 할 수 있습니다:

개요(AI 번역)

** 30 초에 MCP 서버로 모든 API를 켜십시오. **


OpenAPI spec 또는 Postman 컬렉션에서 포인트 mcpgen. ** 완전 파이썬 MCP 서버를 가져 오기 ** - mcpgen의 실행 시간 의존도 없음, 프록시 없음, 잠금 없음. 다운로드 수정하기 배송하기


설치

퀵스타트

그게 다. mcpgen는 spec을 읽고 Python MCP 서버를 디스크로 작성합니다.


당신이 얻는 무엇

자체 유지 디렉토리 소스 코드와 함께:

** 즉시:**

** 생성된 server.py는 다음과 같습니다.**

까만 상자 없음. 런타임에 의존하지 않습니다. 그냥 파이썬.


Claude 데스크탑에 추가

mcpgen] claude_desktop_config.json]에 붙여넣기 위해 정확한 구성 스니펫을 인쇄합니다:

**Config 파일 위치: **

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • 윈도우: %APPDATA%\Claude\claude_desktop_config.json

왜 프록시 대신 소스 코드?

대부분의 API-to-MCP 도구는 **런타임 프록시 ** - Claude와 API를 영원히 앉아서 실행할 수 있습니다.

mcpgen **소스 코드를 생성한다. 출력은 일반 파이썬 파일입니다. 당신은 할 수 있습니다:

  • 무슨 일이 일어나는 일의 각 선을 읽으십시오

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.


Point mcpgen at an OpenAPI spec or Postman collection. Get back a complete Python MCP server you own — no runtime dependency on mcpgen, no proxy, no lock-in. Read it. Modify it. Ship it.


Install

pip install mcpgen-cli

Quickstart

# From a URL
mcpgen https://petstore3.swagger.io/api/v3/openapi.json

# From a local OpenAPI file (JSON or YAML)
mcpgen stripe.yaml

# From a Postman collection
mcpgen postman_collection.json

# Preview without writing anything
mcpgen openapi.json --dry-run

# Custom output directory and server name
mcpgen openapi.json --output ~/my-mcp-servers --name "My API"

That’s it. mcpgen reads your spec and writes a Python MCP server to disk.


What you get

A self-contained directory with source code you own:

stripe_api_mcp/
├── server.py          ← the MCP server (read it, edit it, it's yours)
└── requirements.txt   ← httpx, mcp

Run it immediately:

cd stripe_api_mcp
pip install -r requirements.txt
export STRIPE_API_TOKEN="sk_live_..."
python server.py

The generated server.py looks like this:

#!/usr/bin/env python3
"""
Stripe API MCP Server
Generated by mcpgen — https://github.com/JnanaSrota/mcpgen
This file is yours. Modify it freely.
"""
import os, asyncio, httpx
from mcp.server import Server
from mcp.server.stdio import stdio_server
from mcp import types

BASE_URL = "https://api.stripe.com"
AUTH_TOKEN = os.environ.get("STRIPE_API_TOKEN", "")

app = Server("stripe-api")

@app.call_tool()
async def _handle_get_customers(name: str, arguments: dict):
    if name != "get_customers":
        raise ValueError(f"Unknown tool: {name}")
    url = BASE_URL + "/v1/customers"
    query_params = {}
    if "limit" in arguments:
        query_params["limit"] = arguments["limit"]
    async with httpx.AsyncClient(timeout=30.0) as client:
        response = await client.get(url, params=query_params,
            headers={"Authorization": f"Bearer {AUTH_TOKEN}"})
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "stripe-api-mcp": { "command": "python", "args": ["/path/to/stripe_api_mcp/server.py"], "env": { "STRIPE_API_TOKEN": "your-key-here" } } } }