Overview
The Corelayer MCP server lets MCP-compatible AI clients call Corelayer directly without shelling out to the Corelayer CLI. It is useful for agents that support Model Context Protocol tools. The local MCP server is distributed as an npm package:Prerequisites
- Node.js 18+
- npm
- A Corelayer API key or an existing local Corelayer CLI login
- An MCP-compatible host that can run local stdio MCP servers
Authentication
For customer installs, use a dedicated API key:CORELAYER_API_KEY.
The local MCP server resolves credentials in this order:
CORELAYER_API_KEY- the local CLI token from
~/.corelayer/config.json
CORELAYER_API_KEY because it is explicit, revocable, and easier to
audit.
Coding Agent Setup
Add Corelayer to your MCP-compatible coding agent’s server configuration. The exact config file path depends on the host; use the location where your agent expects MCP server definitions.Optional Default Group
If your agent usually works in one Corelayer group, setCORELAYER_DEFAULT_GROUP so tools can omit groupId:
CORELAYER_DEFAULT_GROUP is not set, the agent can call
corelayer.list_groups first and pass the selected groupId to group-scoped
tools.
Available Tools
| Tool | Type | Description |
|---|---|---|
corelayer.list_groups | Read | List Corelayer groups the API key can access. |
corelayer.list_issues | Read | List issues for a group with filters and pagination. |
corelayer.get_issue | Read | Fetch detailed issue context, root cause, trace, and metadata. |
corelayer.get_issue_summary | Read | Fetch issue summary statistics for a group. |
corelayer.list_integrations | Read | List connected integration accounts. |
corelayer.search_org_memory | Read | Search organization memory for historical context. |
corelayer.close_issue | Write | Close one issue, optionally with feedback. |
corelayer.reopen_issue | Write | Reopen one issue, optionally with feedback. |
corelayer.bulk_close_issues | Write | Close multiple explicitly selected issues. |
corelayer.bulk_close_issues requires explicit issue IDs, caps requests at 500
IDs, and never uses a select-all mutation.
Example Agent Prompts
Ask the agent:Environment Variables
| Variable | Description | Default |
|---|---|---|
CORELAYER_API_KEY | Corelayer API key or token. | CLI config fallback |
CORELAYER_API_URL | Corelayer API base URL. | https://api.corelayer.com |
CORELAYER_DEFAULT_GROUP | Optional group ID used by group-scoped tools. | — |
CORELAYER_TIMEOUT_MS | Corelayer API request timeout in milliseconds. | 30000 |
Verify the Package
Check that npm can see the package:Troubleshooting
| Symptom | Fix |
|---|---|
| The host says the server exited immediately. | Confirm Node.js 18+ is installed and npx -y @corelayer-ai/mcp runs. |
| Tools fail with missing auth. | Set CORELAYER_API_KEY or run corelayer login locally. |
| Tools fail with permission errors. | Create a key for the correct Corelayer organization. |
Group-scoped tools ask for groupId. | Set CORELAYER_DEFAULT_GROUP or call corelayer.list_groups first. |
| The terminal appears to hang. | This is normal; stdio MCP servers wait for JSON-RPC input from the host. |