Skip to main content
Glama
bvenkata

mcp-api-connect

by bvenkata

mcp-api-connect

License: MIT Python 3.10+

1つのペイロードで、あらゆるAPIに対応。 mcp-api-connectは、プロトコルと認証に依存しないコネクタエンジンです。ターゲットサービス(URL、プロトコル、認証、リクエスト/レスポンスの形状)を一度記述すれば、正規化されたペイロードを送信して、正規化されたレスポンスを受け取ることができます。ターゲットがREST/JSON API、レガシーSOAPサービス、APIキー、Basic認証、Bearerトークン、OAuth2クライアントクレデンシャルで保護されているかどうかは関係ありません。

同じコアエンジン上に構築された3つの形態で提供されるため、どのように使いたいかに応じて選択できます:

  • Pythonライブラリpip install mcp-api-connect を実行し、MCPAPIConnectEngine を直接呼び出します。サーバーは不要です。

  • スタンドアロンHTTP APIpip install mcp-api-connect[api] を実行し、mcp-api-connect-api を起動して、/invoke にPOSTします。

  • MCPサーバーpip install mcp-api-connect[mcp] を実行し、mcp-api-connect を起動して、任意のMCPクライアント(Claudeなど)からエージェントが登録済みコネクタ(またはその場で任意のサービス)をツールとして呼び出せるようにします。

なぜ

すべての統合プロジェクトは同じ車輪を再発明しています。ここにRESTクライアント、あそこにSOAPクライアント、サービスごとに1つの認証フロー、コードベース全体に散らばったアドホックなリクエスト/レスポンスマッピング。mcp-api-connectはこれらを1つの宣言的仕様(InvokeSpec)と1つの実行エンジンに集中化するため、新しいターゲットサービスの追加はコードではなく設定で済みます。

Related MCP server: MCP REST Server

クイックスタート(ライブラリ)

pip install mcp-api-connect
import asyncio
from mcp_api_connect import MCPAPIConnectEngine, InvokeSpec, Target, AuthSpec, AuthType, RequestFormat, ResponseFormat

spec = InvokeSpec(
    target=Target(base_url="https://api.example.com"),
    auth=AuthSpec(type=AuthType.API_KEY, config={"api_key": "secret", "header_name": "X-API-Key"}),
    request_format=RequestFormat(method="POST", path="/v1/orders", content_type="json"),
    response_format=ResponseFormat(content_type="json"),
)

async def main():
    async with MCPAPIConnectEngine() as engine:
        result = await engine.invoke(spec, {"customer": "jane"})
        print(result.success, result.data)

asyncio.run(main())

クイックスタート(HTTP API)

pip install "mcp-api-connect[api]"
mcp-api-connect-api   # serves on :8000, interactive docs at /docs
curl -X POST http://localhost:8000/invoke -H 'content-type: application/json' -d '{
  "spec": {
    "target": {"base_url": "https://api.example.com"},
    "auth": {"type": "api_key", "config": {"api_key": "secret"}},
    "request_format": {"method": "POST", "path": "/v1/orders"},
    "response_format": {"content_type": "json"}
  },
  "payload": {"customer": "jane"}
}'

再利用可能なコネクタを一度登録し、名前で呼び出します:

curl -X POST http://localhost:8000/connectors -d '{"name": "orders-api", "spec": {...}}'
curl -X POST http://localhost:8000/connectors/orders-api/invoke -d '{"customer": "jane"}'

クイックスタート(MCP)

pip install "mcp-api-connect[mcp]"
{
  "mcpServers": {
    "mcp-api-connect": { "command": "/path/to/.venv/bin/mcp-api-connect" }
  }
}

ツールとして invoke(ステートレス、一回限り)、register_connectorlist_connectorsinvoke_connector(名前指定)、delete_connector を公開します。エージェントは「Salesforce API」用のコネクタを一度登録すれば、その後は「このペイロードで呼び出して」と言うだけで済みます。

➜ Claude Desktop / Claude Code / Cursor の完全なセットアップ、永続化、セキュリティメモ、および実例については、docs/mcp-integration.md を参照してください。

コアコンセプト

  • Target — ベースURL、プロトコル(rest | soap)、タイムアウト、デフォルトヘッダー。

  • AuthSpectypenoneapi_keybasicbeareroauth2_client_credentials)と、そのタイプに合わせた config ディクショナリ。OAuth2トークンは自動的に取得・キャッシュされます。

  • RequestFormat / ResponseFormat — コンテンツタイプ(jsonxmlsoap)に加え、コードを書かずにペイロードを再整形するための宣言的 field_map{"target.path": "$.source.jsonpath"})、または完全な制御のためのJinja2 body_template(SOAPエンベロープに必須)。

  • InvokeSpec — 上記3つをまとめたもので、「1つのサービスに到達する方法」の単位。名前付き Connector として保存するか、呼び出しごとにインラインで渡します。

完全なスキーマは src/mcp_api_connect/core/models.py を、各認証 type が期待する config の形状は docs/auth-reference.md を参照してください。

ドキュメント

  • docs/mcp-integration.md — MCPクライアントの完全なセットアップ(Claude Desktop、Claude Code、Cursor)、永続化、セキュリティ、ツールリファレンス、実例、トラブルシューティング

  • docs/auth-reference.md — すべての認証タイプの config フィールド

  • CONTRIBUTING.md — 開発環境のセットアップ、テストの実行、PRの期待事項

拡張

  • 新しい認証タイプ:AuthStrategy を実装し、engine.register_auth_strategy(...) で登録します。

  • 新しいプロトコル(例:GraphQL):ProtocolAdapter を実装し、engine.register_adapter(...) で登録します。

  • 新しいコネクタストレージバックエンド:ConnectorStore を実装します(InMemoryConnectorStoreSqliteConnectorStore が同梱されており、資格情報はFernetで暗号化されて保存されます)。

ロードマップ

  • OAuth2認可コードフロー、mTLS、AWS SigV4認証戦略

  • WSDL駆動のSOAP(オプションの zeep ベースのアダプタ、手書きのエンベロープは不要)

  • GraphQLアダプタ

  • Postgresバックエンドの ConnectorStore

  • コネクタごとのリトライ/バックオフとレート制限ポリシー

  • 公開デプロイ向けのSSRF安全なターゲット許可リスト

開発

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev,api,storage,mcp]"
pytest

ライセンス

MIT — LICENSE を参照してください。

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables interaction with over 2,800 APIs and applications through Pipedream's Connect platform. Provides managed OAuth authentication and API request capabilities for integrating multiple services through natural language.
  • F
    license
    A
    quality
    D
    maintenance
    Enables interaction with any REST API through token or login authentication, with automatic Swagger/OpenAPI documentation integration for endpoint discovery and comprehensive HTTP request support.
    7
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI agents to discover, search, and call any REST API described by an OpenAPI or Swagger document. Supports multiple API endpoints with authentication and parameter handling.
    25
    MIT

View all related MCP servers

Related MCP Connectors

  • Connect AI assistants to Stellary projects, boards, documents, and governed agent workflows.

  • Search, document and execute authenticated API calls across 700+ apps via one MCP server

  • Connect MCP clients to 2,000+ AI models without managing provider API keys.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bvenkata/mcp-api-connect'

If you have feedback or need assistance with the MCP directory API, please join our Discord server