AI and MCP.
Agent connection, discovery and result verification.
Connection
This deployment's MCP address: https://ctx4.me/mcp. Cloud clients need a reachable HTTPS address. A client supporting remote HTTP MCP discovers OAuth, opens browser sign-in and requests access to the selected workspace. This flow does not require a Context4 API key. The quickstart begins with a ready-made prompt on the connection page.
Do not construct a provider authorization URL manually. Context4 returns the link. Signing in to Context4 and connecting a provider account are separate permissions. A provider may require its own key, OAuth consent or credentials entered in a secure form.
Automations can use an API key in Authorization: Bearer, x-consumer-api-key or x-api-key, according to client configuration. The secret is not included in the URL. The HTTP resource supports POST, GET, DELETE /mcp; transport is Streamable HTTP.
Agent sequence
CONTEXT4_SEARCH_TOOLS: find an action for the task; check connection status and tags.CONTEXT4_GET_TOOL_SCHEMAS: retrieve exact input/output schemas for the discoveredtool_slugvalues.CONTEXT4_MANAGE_CONNECTIONSwithaction: list: check accounts. Withaction: connect, obtain an existing active connection or a hosted Connect Link.- Show the returned link to the user. If
connection_idis available, callCONTEXT4_WAIT_FOR_CONNECTIONS; repeat according toretry_after_msuntil active or a terminal refusal. CONTEXT4_MULTI_EXECUTE_TOOL: submit 1–20 tools with schema-based arguments; explicitly specifyconnection_idif multiple accounts exist.- Check each
resultsitem:succeeded,pendingorerror. Report empty data as empty; do not present pending as success.
The complete set and schemas: MCP tools. Search ranks matches and is not a complete integration inventory. Tags read-only, destructive, idempotent, open-world, curated help selection; all tags must match, while any matching exclude_tags excludes a result.
Sessions and dynamic tools
The global /mcp exposes five stable meta-tools. The session address /mcp?session= is returned during session creation and exposes its tool snapshot, meta-tools enabled by feature flags and context4.get_execution. Provider tool schemas depend on the pinned catalog version; use the actual tools/list response.
context4.get_execution accepts an object whose sole required string field is execution_id; the schema declares no additional fields. It retrieves the state and terminal result of a pending call. SDK session mode also publishes enabled aliases COMPOSIO_SEARCH_TOOLS, COMPOSIO_GET_TOOL_SCHEMAS, COMPOSIO_MANAGE_CONNECTIONS, COMPOSIO_WAIT_FOR_CONNECTIONS, COMPOSIO_MULTI_EXECUTE_TOOL. They route to the same handlers.
If the session's workbench flag is enabled, COMPOSIO_REMOTE_WORKBENCH and COMPOSIO_REMOTE_BASH_TOOL may be listed: they return not_supported because this deployment does not implement a remote sandbox. A listed name does not promise a working shell.
A readOnly session permits only tools tagged read-only; a tool without the tag is treated as a write. Search and meta-execution within that session inherit the restriction. Session TTL, revocation and call budget are also checked during execution.
Results and errors
An MCP response includes structuredContent and text JSON in content. Unknown names or invalid arguments produce an error result with isError: true; transport success alone does not mean tool success. Check errors separately in each batch results item.
connection_required requires connection, connection_ambiguous requires account selection, authorization_pending requires waiting and invalid_arguments requires checking the schema. For permission_denied and rate_limited, address the restriction; for execution_pending, use the execution ID and specified interval. execution_failed does not prove that an external write was not applied.
Read access does not authorize an agent to perform a test write. Make the first check a safe available read. Deletions, changes and messages require an explicit user task.