@rockship/code-memory-mcp
v1.2.51
Published
A powerful Model Context Protocol (MCP) server implementation for seamless code memory integration, enabling AI assistants to interact with code memory data
Maintainers
Readme
Code Memory MCP
Project Overview
@rockship/code-memory-mcp is a Model Context Protocol (MCP) server that provides a powerful code‑memory integration layer for AI assistants. It enables AI agents to store, retrieve, and reason over project‑specific code artifacts, facilitating context‑aware interactions such as code search, documentation lookup, and automated refactoring.
The server is built with TypeScript and runs on Node.js. It leverages the @modelcontextprotocol/sdk to expose a set of handlers for:
- Resource management (files, memories, configurations)
- Prompt handling (custom system prompts for AI)
- Tool integration (search, edit, version control)
- Real‑time streaming of logs and notifications via SSE or standard I/O.
Key Features
- MCP‑compliant server exposing a standard API for AI assistants.
- Modular architecture with separate handlers for resources, prompts, tools, and completions.
- Supports multiple transport modes:
stdio,sse, and HTTP. - Automatic subscription handling for real‑time updates.
- Configurable via a simple
code-memory.jsonproject file.
Installation
# Install dependencies
pnpm install
# Build the project
pnpm run buildUsage
The entry point is the code-memory-mcp CLI. Choose a script to run:
# Run the default stdio server (recommended for local development)
pnpm start
# Run the Server‑Sent Events server
pnpm run start:sse
# Run the streamable HTTP server
pnpm run start:streamableHttpYou can also invoke a specific script directly:
node dist/index.js stdio # or sse, streamableHttp, initProject Structure
src/
├─ adapters/ # Adapter layer for external clients
├─ interfaces/ # TypeScript interfaces for client & query contracts
├─ network/ # HTTP client implementation
├─ prompts/ # System prompts and instructions used by the AI
├─ server/ # Core server logic and handler registrations
│ ├─ handlers.ts # Main request handlers
│ ├─ resources.ts # Resource (file/memory) management
│ ├─ tools.ts # Tool registration for AI actions
│ └─ …
├─ utils/ # Helper utilities and constants
├─ cli.ts # CLI entry point for init script
├─ code-memory.ts # Server factory and configuration
├─ index.ts # Dynamic script loader
└─ sse.ts / stdio.ts # Transport implementationsConfiguration
The server reads its configuration from code-memory.json (generated on first run). Example:
{
"project_id": "73d22542-6ef2-47c7-9a1e-89f6b5ed55e7",
"project_name": "Code Memory MCP",
"repo_url": "[email protected]:Rockship-Team/code-memory-mcp.git",
"created_at": "2025-10-28T10:25:09.735230Z"
}Development
- Watch mode:
pnpm run watchrecompiles on file changes. - Testing: Add tests under a
tests/directory and run with your preferred test runner. - Release: Use
pnpm run release(changesets) to publish a new version.
License
MIT © Rockship
