LogicMap MCP Server
Enables creating and querying semantic knowledge graphs to model business logic, code relationships, and project structure across multiple projects.
README
LogicMap MCP Server
An MCP server implementation that provides semantic knowledge graph tools for understanding project structure, business logic, and code relationships.
Features
- Semantic Knowledge Graph: Record business logic and conceptual relationships, not just code structure
- Multi-Project Management: Manage multiple project knowledge graphs simultaneously
- Rich Node Types: Support for concepts, flows, modules, components, data entities, and external dependencies
- Relationship Modeling: Express various logical relationships (calls, depends, implements, flows_to, uses_data, triggers, extends)
- Powerful Query Tools: Search nodes, query relationships, and explore graph structure
- Language Agnostic: No dependency on specific language parsers, works with any codebase
- Progressive Construction: Build knowledge graphs incrementally, starting with core flows
Tools
Project Management
- createProject: Create a new project with metadata
- updateProject: Update project information
- deleteProject: Remove a project
- listProjects: List all available projects
Node Management
- addNode: Add a semantic node to the knowledge graph
- Types:
concept,flow,module,component,data,external - Supports tags, file associations, and custom metadata
- Types:
- updateNode: Update existing node information
- removeNode: Remove a node and optionally cascade delete related edges
Relationship Management
- linkNodes: Create relationships between nodes
- Types:
calls,depends,implements,flows_to,uses_data,triggers,extends - Supports relationship strength and descriptions
- Types:
- unlinkNodes: Remove relationships between nodes
Query Tools
- queryNode: Get detailed node information with relationships
- Supports neighbor traversal with configurable depth
- searchNodes: Search nodes by criteria
- Filter by type, tags, files, or text content
- Configurable result limits
Usage
LogicMap is designed for:
- Understanding complex codebases and business logic
- Documenting system architecture and data flows
- Impact analysis before making changes
- Onboarding new team members
- AI-assisted code comprehension
- Cross-team knowledge sharing
Configuration
Usage with Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"logicmap": {
"command": "node",
"args": [
"/absolute/path/to/logicmap-mcp-server/dist/index.js"
]
}
}
}
Usage with Kiro (compatible with other vscode based IDE)
Add the configuration to your MCP configuration file. Open the Command Palette (Ctrl + Shift + P or Cmd + Shift + P) and run MCP: Open User Configuration. This will open your user mcp.json file where you can add the server configuration.
User Configuration (Recommended):
{
"mcpServers": {
"logicmap": {
"command": "node",
"args": [
"/absolute/path/to/logicmap-mcp-server/dist/index.js"
]
}
}
}
Workspace Configuration:
Alternatively, create .kiro/settings/mcp.json in your workspace:
{
"mcpServers": {
"logicmap": {
"command": "node",
"args": [
"/absolute/path/to/logicmap-mcp-server/dist/index.js"
]
}
}
}
For more details about MCP configuration, see the Kiro MCP documentation.
Configuration Example
See mcp-config-example.json for a complete configuration example.
Installation
From Source
# Clone the repository
git clone https://github.com/yourusername/logicmap-mcp-server.git
cd logicmap-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
Verify Installation
After building, test the server:
# Run tests
npm test
# Check build output
ls dist/
Development
# Development mode (watch for changes)
npm run dev
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Lint code
npm run lint
# Format code
npm run format
# Clean build output
npm run clean
Example Usage
Creating a Knowledge Graph
// 1. Create a project
await createProject({
name: "My Web App",
description: "E-commerce platform",
workspacePath: "/path/to/project"
});
// 2. Add semantic nodes
await addNode({
id: "user-auth-flow",
type: "flow",
name: "User Authentication Flow",
description: "Handles user login, token validation, and permission checks",
files: ["src/auth/controller.ts", "src/auth/service.ts"],
tags: ["core", "security"]
});
await addNode({
id: "payment-service",
type: "module",
name: "Payment Service",
description: "Integrates with Stripe and PayPal for payment processing",
files: ["src/payment/processor.ts"],
tags: ["core", "third-party"]
});
// 3. Create relationships
await linkNodes({
from: "user-auth-flow",
to: "payment-service",
type: "depends",
description: "Payment requires authenticated user session"
});
// 4. Query the graph
const result = await queryNode({
id: "user-auth-flow",
includeNeighbors: true,
depth: 2
});
// 5. Search nodes
const searchResults = await searchNodes({
tags: ["core"],
types: ["flow", "module"],
limit: 10
});
Project Structure
logicmap-mcp-server/
├── src/
│ ├── index.ts # Entry point
│ ├── types/ # TypeScript type definitions
│ ├── schemas/ # JSON Schema validation
│ ├── services/ # Core business logic
│ │ ├── NodeService.ts # Node CRUD operations
│ │ ├── EdgeService.ts # Relationship management
│ │ └── QueryService.ts # Graph queries
│ ├── storage/ # Data persistence
│ │ └── StorageManager.ts # File-based storage with locking
│ └── mcp/ # MCP protocol implementation
│ └── MCPServerHandler.ts
├── tests/ # Test files
├── dist/ # Build output
└── package.json
Data Storage
LogicMap stores project data in ~/.logicmap/projects/ as JSON files:
~/.logicmap/
└── projects/
└── {project-id}/
└── graph.json # Complete knowledge graph
Each graph file contains:
- Project metadata
- Node dictionary (for O(1) lookups)
- Edge list
- Timestamps
Tech Stack
- Runtime: Node.js >= 18.0.0
- Language: TypeScript 5.3+
- Protocol: Model Context Protocol (MCP)
- Validation: Ajv (JSON Schema)
- Storage: JSON files with proper-lockfile
- Testing: Vitest + fast-check
Building
# Build TypeScript to JavaScript
npm run build
# Output will be in dist/ directory
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Links
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。