Create MCP Servers with AI Agents

API To MCP can be used from the dashboard UI or directly from your AI agent. Connect the official manager MCP server once, then ask your agent to create, test, deploy, stop, start, or inspect MCP servers for your account.

Official Manager MCP Server

Use this URL in AI agents and IDEs that support remote HTTP MCP servers:

https://mcp.apitomcp.app/

Need to list MCP servers from your own AI platform?

Use the MCP Discovery API when your product needs to show public or user-owned MCP servers and retrieve their MCP URLs for connection.

Open MCP Discovery API docs

When to Use This Flow

  • Use the UI when you want full visual control over each field.
  • Use the manager MCP when you want your coding agent to generate tools, schemas, and test payloads from a short prompt.
  • Use both together: let the agent create a server, then refine it in the dashboard.

1. Create a Manager Token

  1. Open Settings Tokens.
  2. Create a token for your AI agent.
  3. Grant only the permissions the agent needs. Use MCP Server permissions for server creation and testing, and Template permissions only when the agent should share, edit, or publish templates.
  4. Store the token in an environment variable such as API_TO_MCP_MANAGER_TOKEN.

Token Behavior

The manager MCP server uses the Bearer token sent by your agent as the API To MCP Manager Token. This is different from a deployed server that uses public access and no token, or a deployed server that requires a client token for extra protection.

2. Add the Manager MCP Server

Codex

In Codex, open MCP Servers, choose Add server, then enter:

  • URL: https://mcp.apitomcp.app/
  • Authentication: OAuth if you want the UI sign-in flow, or Bearer token if you prefer an Account Token.
  • Bearer token env var: use an environment variable name such as API_TO_MCP_MANAGER_TOKEN, not the token value.

CLI setup still works and is useful for local developer environments:

codex mcp add api_to_mcp --url https://mcp.apitomcp.app/
codex mcp list

If editing ~/.codex/config.toml directly:

[mcp_servers.api_to_mcp]
	url = "https://mcp.apitomcp.app/"
	bearer_token_env_var = "API_TO_MCP_MANAGER_TOKEN"

ChatGPT

Add API To MCP from ChatGPT's connector or app settings:

  1. Create a new custom connector.
  2. Set the server URL to https://mcp.apitomcp.app/.
  3. Choose OAuth authentication and complete the API To MCP sign-in flow.
  4. Refresh the tool list and confirm the manager tools are visible.

Claude

In Claude, add a custom connector with https://mcp.apitomcp.app/. Claude can discover the server tools from the UI. If OAuth is requested, complete the sign-in flow before calling management tools.

Cursor

Add a remote MCP server from Cursor settings when available, or add this to~/.cursor/mcp.json or your project MCP config:

{
  "mcpServers": {
    "api-to-mcp": {
      "url": "https://mcp.apitomcp.app/",
      "headers": {
        "Authorization": "Bearer ${env:API_TO_MCP_MANAGER_TOKEN}"
      }
    }
	}
}

Antigravity

Add a remote HTTP MCP server from Antigravity's MCP settings. Usehttps://mcp.apitomcp.app/ as the URL. If you are using an Account Token, configure Authorization: Bearer ${API_TO_MCP_MANAGER_TOKEN} through the UI or environment-backed headers.

VS Code

Add this to .vscode/mcp.json:

{
  "servers": {
    "api-to-mcp": {
      "type": "http",
      "url": "https://mcp.apitomcp.app/",
      "headers": {
        "Authorization": "Bearer ${env:API_TO_MCP_MANAGER_TOKEN}"
      }
    }
  }
}

Claude Code

Add the remote HTTP server from the project where you use Claude Code:

claude mcp add --transport http api-to-mcp https://mcp.apitomcp.app/
claude mcp list

If your Claude Code setup supports request headers, add Authorization: Bearer ${API_TO_MCP_MANAGER_TOKEN} in its MCP server settings.

3. Ask Your Agent to Create a Server

The manager MCP tool schema supports REST and GraphQL tools, workflow tools, response mapping, output schemas, MCP access settings, and upstream OAuth Client Credentials or Authorization Code. Ask for the auth model explicitly when creating SaaS or internal platform integrations.

Create and deploy a public MCP server for Open-Meteo.
Read the Open-Meteo API documentation, choose the most useful weather tools,
define clear input schemas and JMESPath output mappings, then test the server
with Ho Chi Minh City coordinates and return the deployed MCP URL.

OAuth Authorization Code Example

Create a listed MCP server for our internal support platform.
Read the platform API and OAuth documentation, configure OAuth Authorization Code,
then create the most useful ticket and customer-support tools for employees.
Use compact JMESPath output mappings, test the tools after OAuth is connected,
and return setup notes plus the deployed MCP URL.

Workflow Tool Example

Create a workflow tool named summarize_customer.
Step 1 calls get_customer_by_email.
Step 2 calls list_customer_orders using the customer ID from step 1.
Return the customer profile and recent orders in one JSON response.

Custom OAuth and Authentication Presets

The manager MCP also lets agents use or create authentication presets. Start with the provider's documentation and the live schema, so the recipe matches the engine's supported fields. The dashboard and manager MCP use the same validation contract.

  1. Call get_auth_recipe_schema to read the current schema, placeholders, and engine capabilities.
  2. Use list_auth_presets and get_auth_preset to inspect an existing preset, or draft a definition from the provider's documentation.
  3. Call validate_auth_recipe with mode=definition, then create_auth_preset with a fresh UUID to save a private definition without credentials.
  4. Call create_and_deploy_server with deploy_now=false, pin the preset version, and configure credentials separately.
  5. Complete upstream OAuth with the user, test a safe tool call, and use verify_auth_preset to check authentication and refresh behavior before deployment. Read the receipts with get_auth_preset_checks.
Create a draft MCP server for our commerce provider.
Read its OAuth and API documentation and get_auth_recipe_schema.
Reuse a compatible preset or validate and create a private preset.
Keep credentials out of the preset definition and do not deploy yet.
Return the callback URL and the remaining OAuth and verification steps.

See Authentication Presets for versioning, secret bindings, verification receipts, and supported provider flows.

4. Review the Result

  1. Ask the agent to call list_mcp_servers and confirm the new server is active.
  2. Open the server in the dashboard to review tools, auth, access policy, and usage.
  3. Copy the deployed MCP URL into any AI agent or IDE that should use that specific server.

Best Practices

  • Use short, descriptive server names and tool names.
  • Prefer public access for read-only public-data servers such as weather, sports schedules, or country lookup.
  • Use client token access when you want an extra gate before clients can call the deployed MCP server.
  • Use OAuth Client Credentials for server-to-server APIs such as payment providers.
  • Use OAuth Authorization Code when each end user should connect their own upstream SaaS or enterprise account.
  • For Bearer-token upstream APIs, use stored tokens for private servers and agent Bearer tokens only when each client should bring its own upstream API token.
  • Always test at least one successful tool call before sharing a server URL.