Provides an MCP server that lets you create models, manage fields, and build schemas against Apito’s GraphQL API, with per-request API keys and Cloudflare deployment options.
Configuration
View docs{
"mcpServers": {
"apito-io-apito-mcp": {
"url": "https://apito-mcp.apito.workers.dev/sse",
"headers": {
"APITO_API_KEY": "ak_live_example_123",
"APITO_GRAPHQL_ENDPOINT": "<APITO_GRAPHQL_ENDPOINT>"
}
}
}
}You run an MCP server that lets large language models interact with Apito’s GraphQL API to manage models, fields, and relations. You can deploy it locally for development or run it remotely via Cloudflare Workers to serve multiple projects with per-request API keys. This server exposes convenient tools to create and manage schemas and their relationships, while handling errors with clear messages.
Connect to the MCP server from your MCP client to create models, add fields, define relations, and fetch model schemas. You can run the server locally in STDIO mode to work directly on your machine or deploy it to Cloudflare Workers for remote access. The same worker can serve multiple projects by receiving the API key with each request.
Prerequisites include Node.js and npm. You will install dependencies, then run the server in STDIO mode for local development, or deploy to Cloudflare Workers for remote access.
npm installLocal STDIO mode setup uses environment variables to configure the connection to Apito’s GraphQL endpoint and your API key.
APITO_API_KEY=your-api-key-here npx tsx src/index.tsOptionally, you can use an environment file to configure these values before running the server.
# Create .env file
echo "APITO_API_KEY=your-api-key-here" > .env
echo "APITO_GRAPHQL_ENDPOINT=https://api.apito.io/secured/graphql" >> .env
# Run using the environment file with your startup script
npx tsx src/index.tsYou can deploy to Cloudflare Workers for remote access. The API key is not stored as a Worker secret; it is provided per request by the MCP client via headers or query parameters. This enables a single worker to serve multiple projects.
If you want to override the GraphQL endpoint, you can set it as a secret in the Cloudflare Workers environment.
# Deploy remote worker (API key is passed per-request)
npm run deploy
# Optional: Override GraphQL endpoint secret
npx wrangler secret put APITO_GRAPHQL_ENDPOINT --env productionKey usage patterns include creating models, adding fields with explicit types, defining relationships between models, and exposing model schemas as resources. For remote deployments, you must provide the API key with each request, using one of the supported methods.
Maintain clear naming and explicit field types to avoid errors. For list fields that use dropdowns or multi-selects, supply the fixed list elements and their type in validation.
If you encounter errors, the server provides detailed messages including GraphQL error codes, validation issues, and network errors. Check stderr for STDIO deployments.
Remember to include per-request API keys for remote deployments and to provide the correct GraphQL endpoint if you are not using the default.
Common workflows include creating a new model, adding fields with explicit types, and establishing relationships between models. You can iterate by listing models, viewing a model’s complete schema, then adding or updating fields as your schema evolves.
Create a new model in your Apito project. Required: model_name. Optional: single_record to indicate a single-record model.
Add a field to an existing model. You must specify field_type and input_type explicitly. Supports a variety of field types like text, date, number, boolean, media, object, list, and geo.
Update properties of an existing field in a model. You can modify label, type, input type, validation, and description.
Rename a field within a model. Optionally specify a parent_field if the field is nested.
Remove a field from a model. You can target nested fields with parent_field.
Delete a model from the project. This action removes all data associated with the model.
Retrieve a list of all models in the current project.
Fetch the complete schema for a specific model, including all fields and their types.
Create a relation between two models to define how they connect (has_many or has_one) and optionally name the relation with known_as.