mcp-api-connect
mcp-api-connect
Ein Payload rein, jede API raus. mcp-api-connect ist eine protokoll- und auth-agnostische Connector-Engine: Beschreibe einen Zielservice (URL, Protokoll, Auth, Request-/Response-Form) einmal, sende dann einen normalisierten Payload und erhalte eine normalisierte Antwort zurück – egal ob das Ziel eine REST/JSON-API, ein Legacy-SOAP-Service, geschützt durch einen API-Schlüssel, Basic Auth, ein Bearer-Token oder OAuth2-Client-Credentials ist.
Es wird als drei Dinge geliefert, die auf derselben Kern-Engine basieren, sodass du es nutzen kannst, wie du willst:
Eine Python-Bibliothek –
pip install mcp-api-connect, rufeMCPAPIConnectEnginedirekt auf, kein Server erforderlich.Eine eigenständige HTTP-API –
pip install mcp-api-connect[api], führemcp-api-connect-apiaus, POST an/invoke.Ein MCP-Server –
pip install mcp-api-connect[mcp], führemcp-api-connectaus, richte jeden MCP-Client (Claude usw.) darauf aus, damit ein Agent registrierte Connectors – oder beliebige Dienste spontan – als Tools aufrufen kann.
Warum
Jedes Integrationsprojekt erfindet das Rad neu: hier ein REST-Client, dort ein SOAP-Client, ein Auth-Flow pro Dienst, Ad-hoc-Request-/Response-Mapping über die gesamte Codebasis verstreut. mcp-api-connect zentralisiert das in einer deklarativen Spezifikation (InvokeSpec) und einer Ausführungs-Engine, sodass das Hinzufügen eines neuen Zielservices Konfiguration und nicht Code ist.
Related MCP server: Universal API Connector MCP
Schnellstart (Bibliothek)
pip install mcp-api-connectimport 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())Schnellstart (HTTP-API)
pip install "mcp-api-connect[api]"
mcp-api-connect-api # serves on :8000, interactive docs at /docscurl -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"}
}'Registriere einen wiederverwendbaren Connector einmal und rufe ihn dann per Namen auf:
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"}'Schnellstart (MCP)
pip install "mcp-api-connect[mcp]"{
"mcpServers": {
"mcp-api-connect": { "command": "/path/to/.venv/bin/mcp-api-connect" }
}
}Stellt Tools bereit: invoke (zustandslos, einmalig), register_connector, list_connectors, invoke_connector (per Name), delete_connector. Ein Agent kann einmal einen Connector für „die Salesforce-API“ registrieren und dann einfach sagen „ruf sie mit diesem Payload auf“.
➜ Vollständige Einrichtung für Claude Desktop / Claude Code / Cursor, Persistenz, Sicherheitshinweise und ein durchgearbeitetes Beispiel: docs/mcp-integration.md.
Kernkonzepte
Target– Basis-URL, Protokoll (rest|soap), Timeout, Standard-Header.AuthSpec–type(none,api_key,basic,bearer,oauth2_client_credentials) plus einconfig-Dict, das für diesen Typ geformt ist. OAuth2-Tokens werden automatisch abgerufen und zwischengespeichert.RequestFormat/ResponseFormat– Inhaltstyp (json,xml,soap) plus eine deklarativefield_map({"target.path": "$.source.jsonpath"}) zum Umformen von Payloads ohne Code, oder ein Jinja2-body_templatefür volle Kontrolle (erforderlich für SOAP-Envelopes).InvokeSpec– bündelt die drei oben genannten; die Einheit von „wie man einen Dienst erreicht“. Speichere es als benanntenConnectoroder übergib es inline pro Aufruf.
Siehe src/mcp_api_connect/core/models.py für das vollständige Schema und docs/auth-reference.md für die config-Form, die jeder Auth-type erwartet.
Dokumentation
docs/mcp-integration.md – vollständige MCP-Client-Einrichtung (Claude Desktop, Claude Code, Cursor), Persistenz, Sicherheit, Tool-Referenz, durchgearbeitetes Beispiel, Fehlerbehebung
docs/auth-reference.md –
config-Felder für jeden Auth-TypCONTRIBUTING.md – Entwickler-Setup, Tests ausführen, PR-Erwartungen
Erweitern
Neuer Auth-Typ: Implementiere
AuthStrategy, registriere überengine.register_auth_strategy(...).Neues Protokoll (z. B. GraphQL): Implementiere
ProtocolAdapter, registriere überengine.register_adapter(...).Neues Connector-Speicher-Backend: Implementiere
ConnectorStore(wird mitInMemoryConnectorStoreundSqliteConnectorStoregeliefert, Anmeldedaten werden im Ruhezustand per Fernet verschlüsselt).
Roadmap
OAuth2-Autorisierungscode-Flow, mTLS, AWS-SigV4-Auth-Strategien
WSDL-gesteuertes SOAP (optionaler
zeep-basierter Adapter, kein handgeschriebenes Envelope nötig)GraphQL-Adapter
Postgres-basiertes
ConnectorStoreRetry/Backoff- und Rate-Limiting-Richtlinien pro Connector
SSRF-sichere Ziel-Allowlist für öffentliche Bereitstellungen
Entwicklung
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev,api,storage,mcp]"
pytestLizenz
MIT – siehe LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Any REST/SOAP/GraphQL/OData/SQL API as MCP tools for Claude & ChatGPT. 561 connectors: SAP, ERP.
Connect AI agents to 1000+ apps with managed authentication and tool-calling.
Connect AI agents to 580+ APIs with OAuth or API-key auth. Hosted gateway; API pricing varies.
- ElaichiOAuthai.elaichi
Governed AI agents for the software your company already runs. 400+ connectors, one endpoint.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to connect and interact with common business platforms like Shopify, WordPress, and Calendly via pre-built connectors for tasks such as product management, content operations, and scheduling.1322 PyPI1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to connect to any API by loading OpenAPI, GraphQL, gRPC, or SOAP specs, with a built-in catalog of 2500+ public APIs, supporting secure execution, response filtering, chaining, and parallel calls.34 PyPI4MIT
- AlicenseNot gradedqualityBmaintenanceEnables importing OpenAPI, Swagger, Google Discovery, GraphQL, and HTTP MCP definitions and generating typed agent tools whose calls map to HTTP endpoints under explicit execution policies such as allow, approval, or block. A hosted runtime adds credentials, OAuth scopes, request validation, approvals, and execution traces for safely exposing those endpoints to agents.741 npm4MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to discover and call existing OpenAPI services through governed tools, enforcing policy, approval for destructive operations, and credential handling before requests execute.1Apache 2.0