Skip to content

feat(cursor-plugin): add local read-only AKB MCP integration - #79

Closed
AmanitaHouse wants to merge 20 commits into
ApolloTeam-dev:mainfrom
AmanitaHouse:upstream-contrib/14-cursor-plugin-mcp
Closed

AmanitaHouse wants to merge 20 commits into
ApolloTeam-dev:mainfrom
AmanitaHouse:upstream-contrib/14-cursor-plugin-mcp

Conversation

@AmanitaHouse

Copy link
Copy Markdown

Summary

Add a standards-compliant local stdio MCP server to the AKB Cursor plugin, allowing Cursor Agent to retrieve knowledge-base information through four read-only tools.

Stacking note: This contribution sits on the open Cursor plugin stack (#65–#78), especially #65 (plugin entry points) and #68 (akb/ package). The MCP-only delta versus upstream-contrib/13-toolchain-contract-docs is three commits (6c1f587, 83b2902, cd900e1). Reviewers can use:

AmanitaHouse/ApolloKnowledgeBase@upstream-contrib/13-toolchain-contract-docs...upstream-contrib/14-cursor-plugin-mcp

Implementation

  • Windows-compatible server launcher (tools/akb_mcp_launch.cmd / .js → tools/akb_mcp_server.py)
  • Plugin-packaged MCP configuration (mcp.json; plugin.json sets mcpServers: mcp.json)
  • Standard MCP initialization and capabilities (protocol negotiation including 2025-11-25)
  • Four knowledge-base discovery/read/search tools: akb_get_info, akb_list_sections, akb_search, akb_read_document
  • Newline-delimited JSON-RPC transport (replaces legacy Content-Length framing)
  • Input validation and path protections (relative paths only; .. and absolute paths refused)
  • Offline interoperability tests (tools/test_akb_mcp.py) and Cursor plugin documentation updates
  • Packaging lists MCP server/launcher/mcp.json in the generated akb/ tree
  • One packaging hygiene sync: stale akb/.../main-os-friendly.c mirror matched to the canonical skill asset so package_cursor_plugin.py --check passes

Verification

From contribution head cd900e182d6abb14533f2ac2c3d3adb44d253e34 (equivalent MCP behaviour to verified fork commit 949f920, plus upstream URL adaptation and packaging sync):

  • Automated MCP tests: 36 passed, 0 failed (python tools/test_akb_mcp.py)
  • Plugin packaging check: PASS, 371 packaged files (python tools/package_cursor_plugin.py --check)
  • Standard MCP SDK interoperability (prior evidence on 949f920): initialize, tools/list, tools/call PASS via official MCP Python SDK 1.32.2 and via the Windows cmd launcher
  • Live Cursor Agent invocation: CallDynamicTool namespace plugin-akb-akb-knowledge, tool akb_read_document, path lessons/2026-11-akb-verification.md returned title Automated verification of the knowledge base, and the first V4 test runs
  • Server negotiated protocol version 2025-11-25, received notifications/initialized, completed tools/list and tools/call with no truncation reported
  • check_cursor_plugin.py static/manifest/package matching: PASS; Windows disposable-install PowerShell→WSL path probes still fail in this environment (pre-existing limitation; not claimed as PASS)

Compatibility

  • Local knowledge base only
  • No remote authentication service
  • No HTTP transport added
  • Existing skills and rules preserved
  • Windows launcher verified
  • No changes to AmiGent
  • Plugin repository field remains https://github.com/ApolloTeam-dev/ApolloKnowledgeBase

Known limitations

  • Personal Marketplace import remains a separate Cursor Support issue
  • Full cold-restart persistence across a complete Cursor process quit was not independently reconfirmed for this publication commit; do not treat it as verified here
  • Existing WSL/PyYAML and disposable-install path limitations on Windows hosts remain independently tracked where applicable

Review guidance

The key standards correction was replacing legacy Content-Length framing with newline-delimited JSON-RPC. Content-Length framing prevented the standard MCP stdio client (and Cursor) from dispatching initialize; newline framing restored interoperability with both the official MCP SDK and Cursor.

Please review the MCP-only compare link above when evaluating Files Changed against the full stack that still targets main while #65–#78 remain open.

deryk and others added 20 commits November 22, 2026 14:37
Cursor and Claude Code use the same POSIX entry points. .gitattributes
stops a Windows checkout from putting CR into those scripts, which breaks
sh under WSL. The Claude plugin identity is unchanged.
Point manifests, docs, skills and scaffolding defaults at
ApolloTeam-dev/ApolloKnowledgeBase while still accepting a developer-named
alternate clone such as AmanitaHouse.
The marketplace plugin entry included metadata the published schema rejects. Pin those schemas and fail the static check when an entry uses an unsupported field.
The GitHub marketplace indexer does not install a root source of "." or "./".
Generate a self-contained akb/ from the canonical files and fail when that copy drifts.
Git was normalising those akb copies to LF, so the package freshness check failed on Linux.
Ground apollo-build and guided project setup on a shared classifier so missing or upload-capable targets are never treated as safe compile commands.
apollo-build now distinguishes resolvable v1.0/v1.2 PREFIX shapes and wired
C_INCL_NDK usage from uncertain cases, so a Dev/Stable label alone cannot
invent a compiler path or elevate an informational finding to PROBLEM=.
Reject unknown languages, report that the C-style main.c starter is not a dedicated C++ or assembler program, and keep default workflow checks fixture-only unless --run-toolchain is passed.
… regression check.

Omits the skill and C-starter edits already submitted in upstream PR ApolloTeam-dev#66; those land separately. This remainder covers the experimental C++ starter comment, generated akb/ mirrors and the shared-workflow regression.
Document that the v1.2 label alone does not identify Make targets, and that the inspected installer creates ndk-include rather than the Makefile ndk32/ndk39 paths.
Ship stdio MCP packaging, Windows cmd launch, protocol tests, and docs so local installs can expose search and document tools without credentials.
…ver.

Content-Length framing never parsed the client's initialize request, so every connection timed out.
Unblocks package_cursor_plugin --check and check_cursor_plugin package matching on the Cursor plugin contribution stack.
@AmanitaHouse

Copy link
Copy Markdown
Author

Review note — MCP implementation and stacked-PR dependency

This PR adds the AKB Cursor plugin's local, read-only MCP integration.

It depends on the preceding Cursor plugin contribution stack, ending at #78 (1053c62). The comparison against upstream main therefore includes earlier unmerged contributions.

The MCP-specific delta is 16 files, available here:

AmanitaHouse/ApolloKnowledgeBase@upstream-contrib/13-toolchain-contract-docs...upstream-contrib/14-cursor-plugin-mcp

Verification on the published contribution:

  • 36 MCP protocol tests passed.
  • Plugin packaging validated (371 files).
  • Standard MCP SDK initialization and tool calls passed.
  • Cursor Agent successfully invoked akb_read_document through plugin-akb-akb-knowledge and retrieved the expected document title.
  • Read-only access and document path protections verified.

The original interoperability defect was incorrect Content-Length framing; the corrected server uses newline-delimited JSON-RPC over stdio.

GitHub's fork-workflow approval is still required before hosted CI can complete. The existing Windows/WSL disposable-install validation issue and Personal Marketplace importer issue are separate from the MCP protocol correction.

Please review the incremental comparison after #78. This contribution should be integrated in dependency order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants