Skip to main content

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:
npx -y @corelayer-ai/mcp
The package starts a stdio MCP server. Your MCP host launches it as a local process and communicates with it over standard input and standard output. This page covers the local MCP package. Hosted or team-wide MCP connectors, including hosted Notion Custom Agent connectors, require a remote Corelayer MCP endpoint and are configured separately.

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-keys create --name "Corelayer MCP" --role member
Store the key in your MCP host configuration as CORELAYER_API_KEY. The local MCP server resolves credentials in this order:
  1. CORELAYER_API_KEY
  2. the local CLI token from ~/.corelayer/config.json
Prefer 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.
{
  "mcpServers": {
    "corelayer": {
      "command": "npx",
      "args": ["-y", "@corelayer-ai/mcp"],
      "env": {
        "CORELAYER_API_KEY": "cl_key_...",
        "CORELAYER_API_URL": "https://api.corelayer.com"
      }
    }
  }
}
Restart your agent or editor after changing the MCP config. The command and environment shape are the same for local stdio MCP clients.

Optional Default Group

If your agent usually works in one Corelayer group, set CORELAYER_DEFAULT_GROUP so tools can omit groupId:
{
  "mcpServers": {
    "corelayer": {
      "command": "npx",
      "args": ["-y", "@corelayer-ai/mcp"],
      "env": {
        "CORELAYER_API_KEY": "cl_key_...",
        "CORELAYER_API_URL": "https://api.corelayer.com",
        "CORELAYER_DEFAULT_GROUP": "group-id"
      }
    }
  }
}
If 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

ToolTypeDescription
corelayer.list_groupsReadList Corelayer groups the API key can access.
corelayer.list_issuesReadList issues for a group with filters and pagination.
corelayer.get_issueReadFetch detailed issue context, root cause, trace, and metadata.
corelayer.get_issue_summaryReadFetch issue summary statistics for a group.
corelayer.list_integrationsReadList connected integration accounts.
corelayer.search_org_memoryReadSearch organization memory for historical context.
corelayer.close_issueWriteClose one issue, optionally with feedback.
corelayer.reopen_issueWriteReopen one issue, optionally with feedback.
corelayer.bulk_close_issuesWriteClose 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:
Use Corelayer to list my open issues, sort by last seen, and summarize the top
three that look most urgent.
Or:
Search Corelayer org memory for prior decisions about the Cloudflare log
forwarder, then list related open issues.
For write operations, be explicit:
Close issue <issue-id> in Corelayer with feedback: fixed by deploy 2026-04-16.

Environment Variables

VariableDescriptionDefault
CORELAYER_API_KEYCorelayer API key or token.CLI config fallback
CORELAYER_API_URLCorelayer API base URL.https://api.corelayer.com
CORELAYER_DEFAULT_GROUPOptional group ID used by group-scoped tools.
CORELAYER_TIMEOUT_MSCorelayer API request timeout in milliseconds.30000

Verify the Package

Check that npm can see the package:
npm view @corelayer-ai/mcp version
Expected output:
0.1.0
You can also start the server manually:
CORELAYER_API_KEY=cl_key_... npx -y @corelayer-ai/mcp
The command starts a stdio MCP server and waits for MCP JSON-RPC messages. In a terminal it may look idle; that is expected. Your MCP host is responsible for sending requests.

Troubleshooting

SymptomFix
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.