Connect your editor to the MCP server
The Cogneris MCP server puts the Cogneris platform inside the AI assistant of your code editor. Once it is connected, the assistant can search the Cogneris documentation, read the exact contract of any API route, create API keys and webhooks, train classifiers and run fill jobs — on your tenant, with the same audit trail as the REST API.
It is an endpoint of the platform you already use, not a second product: every tool call reaches the same Cogneris services as the REST API, with the same tenant, the same metering and the same audit trail.
Server URL
One URL per production region. Use the region your tenant lives in — the one of the API host you already
call (api-eu, or api-us for a tenant in the United States). New tenants are created in Europe.
| Region | MCP server URL |
|---|---|
| Europe (default) | https://mcp-eu.cogneris.ai/ |
| United States | https://mcp-us.cogneris.ai/ |
The JSON-RPC endpoint is the root path /. There is no /mcp sub-path: a client configured with one gets a
404.
Generate a developer token
The developer token is the recommended way in: one credential, scoped and expiring, that keeps your editor connected for up to 90 days.
- In the Cogneris platform, open Vision → MCP. The page shows your server URL, configuration ready to paste for each editor, and the token generator.
- Give the token a name that says where it is used (for example "VS Code — laptop").
- Choose a validity of 30 or 90 days.
- Choose the scopes.
mcp.readandmcp.writeare ticked by default. Addapikeys.manageandwebhooks.manageonly if the assistant should manage API keys and webhooks. - Copy the token. It is shown once — generate a new one if you lose it.
Every action taken with the token is recorded against your user. Revoke it from the same page when you no longer need it.
The token connects your editor to the MCP server. The code you ship calls the REST API with an API key — which the assistant can create for you.
Add the server to your editor
Replace the URL with the one of your region.
- VS Code
- Visual Studio
- Cursor
- Claude Code
- Your own client
Create .vscode/mcp.json in your project. The token is a password input: VS Code asks for it once, keeps it
in its secret storage and never writes it to the file — so the file is safe to commit and every developer on
the team gets the same configuration.
{
"inputs": [
{
"id": "cogneris-token",
"type": "promptString",
"password": true,
"description": "Cogneris developer token"
}
],
"servers": {
"cogneris": {
"type": "http",
"url": "https://mcp-eu.cogneris.ai/",
"headers": { "Authorization": "Bearer ${input:cogneris-token}" }
}
}
}
Then open Copilot Chat, switch to Agent mode and check that the Cogneris tools are enabled in the tools picker. MCP: List Servers in the command palette shows whether the server is running.
Visual Studio 2022 (17.14 or later) reads MCP servers from %USERPROFILE%\.mcp.json. That file holds the
token in plain text, so keep it in your user profile and out of any repository.
{
"servers": {
"cogneris": {
"type": "http",
"url": "https://mcp-eu.cogneris.ai/",
"headers": { "Authorization": "Bearer <YOUR_COGNERIS_TOKEN>" }
}
}
}
Restart Visual Studio, open Copilot Chat, choose Agent mode and enable the Cogneris tools in the tools list.
Put this in ~/.cursor/mcp.json and replace the placeholder with your token. The file holds the token in
plain text, so keep it out of any repository.
{
"mcpServers": {
"cogneris": {
"url": "https://mcp-eu.cogneris.ai/",
"headers": { "Authorization": "Bearer <YOUR_COGNERIS_TOKEN>" }
}
}
}
One command registers the server. Replace the placeholder with your token.
claude mcp add --transport http Cogneris https://mcp-eu.cogneris.ai/ \
--header "Authorization: Bearer <YOUR_COGNERIS_TOKEN>"
The server speaks stateless streamable HTTP, so a single POST lists the catalog. Send both content types in
Accept — replies are SSE-framed.
curl -sS https://mcp-eu.cogneris.ai/ \
-H "Authorization: Bearer $COGNERIS_MCP_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
Check the connection
Ask the assistant:
Who am I connected as on Cogneris?
It calls cogneris_whoami and answers with your tenant, user and e-mail, how you signed in, sandbox or
production, the granted scopes and the API base URL your code should call. If that works, everything else
will.
Browser sign-in instead of a token
Configure the URL without the Authorization header. The server answers the first call with 401 and a
WWW-Authenticate header that points to its metadata — the signal an MCP client uses to open the Cogneris
sign-in page of your region in the browser (authorization code with PKCE; there is no client secret in your
configuration).
- The session lasts 1 hour, a security control of the Cogneris sign-in. To stay connected for days, use a developer token.
- Browser sign-in grants
mcp.readandmcp.write. The API key and webhook tools need a developer token that carries their scopes.
Scopes
A tool whose scope your credential lacks is not listed, and refuses to run if called.
| Scope | What it unlocks |
|---|---|
mcp.read | Every listing and lookup: account, usage, docs and API reference, classifiers, fill templates and jobs, the webhook event catalog. |
mcp.write | Creating classifiers, adding samples and training them, registering fill templates, uploading sources and starting fill jobs. |
apikeys.manage | Listing, creating and revoking API keys. Never implied by mcp.write. |
webhooks.manage | Managing webhook endpoints and deliveries. Never implied by mcp.write. |
What the assistant can do
35 tools in six areas. You never call them by name — you describe what you want and the assistant picks them.
| Area | Tools | What the assistant does with them |
|---|---|---|
| Account and usage | cogneris_whoami, cogneris_usage_summary | Confirms who the connection acts as; reports documents, pages and AI tokens per day and per document type. |
| Docs and API reference | cogneris_docs_search, cogneris_docs_get, cogneris_api_operations, cogneris_api_reference | Searches this documentation and reads the exact contract of a route, with ready-to-run Node, Python, C# and curl that read the key from COGNERIS_API_KEY. |
| API keys | cogneris_apikeys_list, cogneris_apikeys_create, cogneris_apikeys_revoke | Creates keys with only the scopes your code needs — sandbox by default. |
| Webhooks | cogneris_webhooks_event_types, cogneris_webhooks_create, cogneris_webhooks_test, cogneris_webhooks_deliveries_list, cogneris_webhooks_deliveries_replay and more | Registers endpoints, returns the signing secret once with receiver code, sends test deliveries, inspects and replays failed ones. |
| Classifiers | cogneris_classifiers_create, cogneris_classifiers_add_samples, cogneris_classifiers_train, cogneris_classifiers_status and more | Creates your own document types from sample files and trains them. |
| PDF fill | cogneris_templates_register, cogneris_sources_upload, cogneris_jobs_create, cogneris_artifacts_download and more | Stamps extracted data into a PDF template and downloads the result. |
The server also ships two ready-made prompts your editor lists in its prompt menu (in VS Code, type / in the
chat): Integrate the Cogneris API into this project and Create and train a Cogneris classifier.
Classifiers are your own document types — the ones the Cogneris app shows as templates. Fill templates are PDF layouts a fill job stamps data into. When you ask "what templates do I have?", the answer you want comes from the classifiers.
Before you let an agent drive
- API keys are sandbox by default. A production key is created only when you explicitly confirm it. Keys
created from the editor never carry
apikeys.manage,mcp.readormcp.write. - Secrets are handed out once. A new API key, webhook signing secret or rotated secret appears in a single
answer. The assistant is told to write it to your git-ignored
.envand never repeat it. - Fill jobs cost credits. An agent looping over a folder spends real budget — cap it in the prompt as well as in the tenant cost cap.
- Creating is not idempotent. Each create call makes a new record; a retried call is a duplicate.
- Uploads cap at 10 MB decoded (about 7.5 MB of file). Larger files go through the REST upload path.
- Signed download URLs expire in 5 minutes. Fetch the file when you get the URL.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
404 on every call | The URL has a path such as /mcp. Use the root: https://mcp-eu.cogneris.ai/. |
401 Unauthorized | Missing, expired or revoked token. Generate a new one in Vision → MCP. |
| The API key or webhook tools are missing | The token lacks apikeys.manage or webhooks.manage, or you signed in through the browser. Generate a token with those scopes. |
406 Not Acceptable from your own client | Send Accept: application/json, text/event-stream. |
| The assistant writes code without calling Cogneris | Make sure the chat is in Agent mode and the Cogneris tools are enabled, then mention Cogneris in the prompt. |
Next
- Prompt cookbook — prompts for extraction, API keys, webhooks and classifiers.
- API quickstart — the REST API the assistant calls for you.