MCP endpoint
This endpoint speaks the Model Context Protocol (MCP), so an MCP-compatible client — an IDE assistant, a plugin's mcp.json, or another agent runtime — can discover and call the tools in your Agent Hub catalogue. It serves the same merged catalogue as List tools: the built-in tools plus the custom HTTP tools and connected-server tools visible to you.
Every call runs as the authenticated user, and tool visibility is enforced both when tools are listed and when one is called, so a client cannot call a tool it was not offered. You can generate a ready-to-use MCP client bundle for your skills with Export skills as a plugin.
Call the MCP endpoint
POST /agent-hub-api/api/mcp
Also available as GET /agent-hub-api/api/mcp DEL /agent-hub-api/api/mcp
Handles Model Context Protocol JSON-RPC requests over HTTP.
A single JSON-RPC 2.0 endpoint over HTTP POST (the MCP Streamable HTTP transport). It is stateless: no session identifier is issued, and there is no server-to-client stream. Send one JSON-RPC request object, or a batch as an array.
The methods it supports are:
initialize— negotiates the protocol version and returns the server's capabilities and name.ping— returns an empty result.tools/list— returns the tools visible to you, each with a JSON-SchemainputSchema.tools/call— runs a tool bynamewith anargumentsobject, and returns its output as MCP content.notifications/*— accepted and acknowledged with no response body, per JSON-RPC.
A request sent as a notification (no id) receives an empty 202 response. A malformed body returns a JSON-RPC parse error. A protocol-level problem (unknown method, bad parameters) comes back as a JSON-RPC error object; a tool that runs but fails returns a normal result with isError set to true. The GET and DELETE methods on this path are not supported and return 405 with an Allow: POST header.
- Authentication
- Bearer token How it works
Body parameters application/json
-
jsonrpcstring RequiredJSON-RPC version. Must be
2.0.Possible values-
2.0
-
-
idstringRequest identifier echoed back in the response. Omit it to send a notification, which receives no response.
-
methodstring RequiredThe method to invoke.
Possible values-
initialize -
ping -
tools/list -
tools/call
-
-
paramsobjectMethod parameters. For
tools/call, an object withname(the tool name) andarguments(an object of tool inputs).
Returns
Returns a JSON-RPC response whose result depends on the method called.
Errors
- 400 The request body is not valid JSON, or is not a valid JSON-RPC request.
- 401 The access token is missing or invalid.
curl -X POST "$VDF_BASE_URL/agent-hub-api/api/mcp" \
-H "Authorization: Bearer $VDF_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "web_search",
"arguments": {
"query": "quarterly revenue benchmarks 2026"
}
}
}' const response = await fetch(`${process.env.VDF_BASE_URL}/agent-hub-api/api/mcp`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VDF_ACCESS_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'tools/call',
params: {
name: 'web_search',
arguments: {
query: 'quarterly revenue benchmarks 2026',
},
},
}),
});
if (!response.ok) throw new Error(`Request failed with status ${response.status}`);
const data = await response.json(); import os
import requests
response = requests.post(
f"{os.environ['VDF_BASE_URL']}/agent-hub-api/api/mcp",
headers={"Authorization": f"Bearer {os.environ['VDF_ACCESS_TOKEN']}"},
json={
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "web_search",
"arguments": {
"query": "quarterly revenue benchmarks 2026",
},
},
},
timeout=30,
)
response.raise_for_status()
data = response.json() {
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "Web search results for 'quarterly revenue benchmarks 2026' (2 results): ..."
}
],
"isError": false
}
}