Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Create a Virtual MCP server

Create an AgentKit Virtual MCP server with only the tools an agent needs, then list, update or delete it, with examples in Python, Node.js and cURL.

Create one Virtual MCP server for each agent role. It lists the connections and tools the agent can use, and gives you a fixed URL that every user of that agent shares. You do this once, not once per user.

  • A connection for each app the agent needs, in AgentKit > Connections. Set up a connection if you haven’t. These examples use github-connect, the GitHub connection new environments include.

  • A client set up as in the Quickstart: actions in Python, scalekit in Node.js. For cURL, get an access token and keep it in TOKEN:

    Terminal window
    TOKEN=$(curl -sS "$SCALEKIT_ENVIRONMENT_URL/oauth/token" \
    -d grant_type=client_credentials \
    -d client_id="$SCALEKIT_CLIENT_ID" \
    -d client_secret="$SCALEKIT_CLIENT_SECRET" | jq -r .access_token)
  1. Pick the smallest set of tools the agent needs. Get exact names from tool search or the scoped tool list, or from each connector’s page in the connector catalog.

    If you leave out tools for a connection, the server gets every tool that connection has when you create it. Tools added to the connector later aren’t included.

  2. Give the server a name that’s unique in the environment, and list the tools for each connection.

    from scalekit.actions.models.mcp_config import McpConfigConnectionToolMapping
    response = actions.mcp.create_config(
    name="repo-assistant",
    description="Reads the user's GitHub repositories and issues",
    connection_tool_mappings=[
    McpConfigConnectionToolMapping(
    connection_name="github-connect",
    tools=["github_user_repos_list", "github_issues_list"],
    ),
    ],
    )
    config_id = response.config.id
    mcp_server_url = response.config.mcp_server_url
    print(config_id, mcp_server_url)
  3. Store the server’s id and mcp_server_url in your configuration. You pass the ID when you mint session tokens, and the URL to your agent. For cURL, keep them in CONFIG_ID and MCP_SERVER_URL.

List servers by name to see the new server and its URL:

response = actions.mcp.list_configs(filter_name="repo-assistant")
for config in response.configs:
print(config.id, config.name, config.mcp_server_url)

Then mint a session token and list the server’s tools from an MCP client.

To change the tools, send the full list for each connection. It replaces the old list.

actions.mcp.update_config(
config_id=config_id,
connection_tool_mappings=[
McpConfigConnectionToolMapping(
connection_name="github-connect",
tools=["github_user_repos_list", "github_issues_list", "github_issue_get"],
),
],
)

Change a server when no agent run is using it, because a run can lose a tool mid-conversation. For a larger change, create a new server and point your agent at its URL.

Deleting a server stops its URL from working immediately, including for session tokens already minted.

actions.mcp.delete_config(config_id=config_id)

The tool name doesn’t exist on that connection. Copy names from tool search or the scoped tool list.

The connection name doesn’t match AgentKit > Connections exactly.

Server names are unique in an environment. Choose another name, or update the existing server.

API reference

The endpoints this page's code calls, with every field and the SDK method for each: