Nenjo Docs
API

MCP Server

Nenjo's built-in MCP server -- Streamable HTTP transport, JSON-RPC protocol, and complete tool reference.

MCP Server

Nenjo includes a built-in Model Context Protocol server that exposes platform resources as tools. Any MCP-compatible client can connect and interact with tickets, projects, agents, pipelines, and more.

Connection Details

PropertyValue
EndpointPOST /mcp
TransportStreamable HTTP
ProtocolJSON-RPC 2.0
AuthAPI key (Authorization: Bearer or X-API-Key)
Protocol Version2025-03-26

Authentication

The MCP endpoint requires an API key. Pass it via either header:

# Authorization header
curl -X POST -H "Authorization: Bearer nen_<key>" ...

# X-API-Key header
curl -X POST -H "X-API-Key: nen_<key>" ...

The key's scopes determine which tools are visible and callable. See API Keys for creating keys.

Protocol Flow

1. Initialize

curl -X POST \
  -H "Authorization: Bearer nen_<key>" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {}
  }' \
  https://your-instance/mcp

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2025-03-26",
    "capabilities": {
      "tools": {}
    },
    "serverInfo": {
      "name": "nenjo",
      "version": "0.1.0"
    }
  }
}

2. Send Initialized Notification

{
  "jsonrpc": "2.0",
  "method": "notifications/initialized",
  "params": {}
}

This is a notification (no id field). The server responds with 204 No Content.

3. List Tools

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/list",
  "params": {}
}

Returns all tools the key's scopes allow. Each tool includes its name, description, input schema, and required scope.

4. Call a Tool

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "tickets_list",
    "arguments": {
      "project_id": "550e8400-e29b-41d4-a716-446655440000",
      "status": "open",
      "limit": 10
    }
  }
}

Response:

{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "[{\"id\": \"...\", \"title\": \"...\", ...}]"
      }
    ]
  }
}

Tool results are returned as text content containing pretty-printed JSON.

Supported Methods

MethodDescription
initializeEstablish connection and exchange capabilities
notifications/initializedClient acknowledgment (no response)
tools/listList available tools (filtered by key scopes)
tools/callExecute a tool

Tool Reference

Tools are organized by resource group. Each tool has a required scope.

Tickets

ToolScopeDescription
tickets_listtickets:readList tickets with optional filters (project_id, status, priority, type, tags, limit, offset)
tickets_gettickets:readGet a ticket by ID with full details
tickets_createtickets:writeCreate a new ticket
tickets_updatetickets:writeUpdate a ticket (partial update)
tickets_deletetickets:writeDelete a ticket by ID

tickets_list parameters:

ParameterTypeDescription
project_iduuidFilter by project
statusstringopen, ready, backlog, assigned, in_progress, done, failed
prioritystringlow, medium, high, critical
typestringbug, feature, task, improvement
tagsstringComma-separated tags
limitintegerMax results (default 50, max 200)
offsetintegerPagination offset (default 0)

tickets_create required parameters: project_id, title

tickets_create optional parameters: description, status (open, ready, backlog), priority, type, tags (string array), complexity (1-5), acceptance_criteria

Projects

ToolScopeDescription
projects_listprojects:readList all projects accessible to the current user
projects_getprojects:readGet a project by ID
projects_createprojects:writeCreate a new project
projects_updateprojects:writeUpdate a project (partial update)

projects_create required parameters: name

projects_create optional parameters: description

projects_update required parameters: id

projects_update optional parameters: name, description, settings (object)

Documents

ToolScopeDescription
documents_listdocuments:readList documents in a project
documents_readdocuments:readRead document content (not yet supported via MCP)
documents_deletedocuments:writeDelete a document from a project

documents_list required parameters: project_id

documents_delete required parameters: project_id, document_id

Agents and Roles

ToolScopeDescription
agents_listagents:readList agents, optionally filtered by project
agents_getagents:readGet an agent by ID
agents_createagents:writeCreate a new agent
agents_updateagents:writeUpdate an agent (partial update)
agents_deleteagents:writeDelete an agent by ID
roles_listagents:readList all agent roles accessible to the current user
roles_getagents:readGet an agent role by ID

agents_create required parameters: name, model

agents_create optional parameters: description, model_provider (openai, anthropic, google; default openai), temperature (0-2, default 0.7), tags (string array)

Pipelines

ToolScopeDescription
pipelines_listpipelines:readList all pipelines accessible to the current user
pipelines_getpipelines:readGet a pipeline by ID with all steps and edges
pipelines_createpipelines:writeCreate a new pipeline
pipelines_updatepipelines:writeUpdate a pipeline (partial update)
pipelines_deletepipelines:writeDelete a pipeline by ID
pipeline_steps_createpipelines:writeAdd a step to a pipeline
pipeline_edges_createpipelines:writeAdd an edge between two pipeline steps

pipelines_create required parameters: name, trigger

pipelines_create optional parameters: description, is_active (default true), max_retries (default 3), metadata (object)

Trigger values: ticket.ready, chat.message, cron

pipeline_steps_create required parameters: pipeline_id, name, step_type

Step types: agent, gate, terminal, council, lambda

pipeline_steps_create optional parameters: agent_id, council_id, role_id, lambda_id, config (object), order_index (integer), position_x, position_y

pipeline_edges_create required parameters: pipeline_id, source_step_id, target_step_id

Edge conditions: always (default), on_pass, on_fail, on_review_pass, on_review_fail

Executions

ToolScopeDescription
executions_listexecutions:readList execution runs with optional filters
executions_getexecutions:readGet an execution run by ID with full details

executions_list parameters: project_id (uuid), status (string), limit (default 50, max 200), offset (default 0)

Councils

ToolScopeDescription
councils_listcouncils:readList all councils accessible to the current user
councils_getcouncils:readGet a council by ID with leader and member details
councils_createcouncils:writeCreate a new council with leader and members
councils_updatecouncils:writeUpdate a council (partial update)
councils_deletecouncils:writeDelete a council by ID

councils_create required parameters: name, leader_role_assignment_id, members (array)

councils_create optional parameters: description, delegation_strategy (round_robin, priority, random; default round_robin), config (object)

Member objects: role_assignment_id (required), priority (integer, default 0)

Chat

ToolScopeDescription
chat_sessions_listchat:readList chat sessions for a project and role
chat_messages_listchat:readList chat messages with optional pagination

chat_sessions_list required parameters: project_id, role_id

chat_sessions_list optional parameters: include_archived (boolean, default false)

chat_messages_list required parameters: project_id, role_id, session_id

chat_messages_list optional parameters: limit (default 50, max 200), before (ISO-8601 timestamp)

Graph

ToolScopeDescription
graph_dependenciesgraph:readGet the dependency graph for a project
graph_execution_ordergraph:readGet topologically sorted execution order for a project

Both tools require: project_id

Error Handling

If a tool call fails due to insufficient scopes:

{
  "jsonrpc": "2.0",
  "id": 3,
  "error": {
    "code": -32001,
    "message": "Scope 'tickets:write' required for tool 'tickets_create'"
  }
}

If a tool is not found:

{
  "jsonrpc": "2.0",
  "id": 3,
  "error": {
    "code": -32601,
    "message": "Tool not found: nonexistent_tool"
  }
}

On this page