๐ค MCP server that gives AI agents deep context about your project - coding standards, knowledge base, todos, database schema & history. Keep your AI assistant consistent and context-aware.
Cursor Buddy MCP
๐ค Keep AI Agents Context-Aware & Consistent
Transform your AI assistant into a context-aware coding partner that understands your project's standards, conventions, and history.
๐ Quick Start โข ๐ Documentation โข ๐ง Tools โข ๐ก Examples
๐ฏ Why Cursor Buddy MCP?
๐ง Context-Aware AIYour AI assistant instantly knows your coding standards, architectural patterns, and project conventions ๐ Centralized KnowledgeAll project documentation and guidelines in one searchable location โ Progress TrackingAutomatic todo management and implementation history tracking |
๐ Real-time UpdatesFile monitoring ensures your AI always has the latest information ๐ Zero Setup FrictionDrop-in Docker container with immediate MCP integration ๐ Intelligent SearchFast, relevant results across all your project context |
๐ Table of Contents
- ๐ฏ Why Cursor Buddy MCP?
- ๐๏ธ Architecture
- ๐ Quick Start
- ๐ง Available Tools
- ๐ก Usage Examples
- ๐ Documentation
- ๐ Best Practices
- ๐ง Advanced Features
- ๐ค Contributing
๐๏ธ Architecture
graph TB
A[AI Assistant] --> B[MCP Client]
B --> C[Cursor Buddy MCP Server]
C --> D[.buddy Directory]
D --> E[Rules]
D --> F[Knowledge]
D --> G[Todos]
D --> H[Database]
D --> I[History]
D --> J[Backups]
C --> K[Search Engine]
C --> L[File Monitor]
C --> M[Backup Manager]
style A fill:#e1f5fe
style C fill:#f3e5f5
style K fill:#e8f5e8
Built on the Model Context Protocol (MCP) using the Go SDK from mark3labs/mcp-go. Communicates over stdin/stdout using JSON-RPC 2.0, making it compatible with MCP clients like Claude Desktop.
๐จ Features
| Feature | Description | |---------|-------------| | ๐ง Tools | 6 interactive tools for managing project context | | ๐ Resources | Project context resource with complete project state | | ๐ Stdio Transport | Standard input/output communication | | โก Real-time Updates | File monitoring with automatic reloading | | ๐ Full-text Search | Bleve-powered search across all content | | ๐พ Automatic Backups | Safe file modifications with rollback capability |
๐ Quick Start
1๏ธโฃ Pull from GitHub Registry
docker pull ghcr.io/omar-haris/cursor-buddy-mcp:latest
2๏ธโฃ Configure Cursor
Add to .cursor/mcp.json
:
โ ๏ธ Important: Replace
/path/to/your/project/
with your actual project directory path!
{
"mcpServers": {
"cursor-buddy-mcp": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "/path/to/your/project/.buddy:/home/buddy/.buddy",
"-e", "BUDDY_PATH=/home/buddy/.buddy",
"ghcr.io/omar-haris/cursor-buddy-mcp:latest"
]
}
}
}
Examples:
- Linux/macOS:
"/home/user/myproject/.buddy:/home/buddy/.buddy"
- Windows:
"C:/Users/User/myproject/.buddy:/home/buddy/.buddy"
- Current directory:
"${PWD}/.buddy:/home/buddy/.buddy"
๐ก How to find your project path:
# Navigate to your project directory and run:
pwd
# Copy the output and replace /path/to/your/project/ with: {output}/.buddy
3๏ธโฃ Create .buddy Structure
Navigate to your project directory and run:
mkdir -p .buddy/{rules,knowledge,todos,database,history,backups}
๐ This will create:
your-project/
โโโ .buddy/
โ โโโ rules/
โ โโโ knowledge/
โ โโโ todos/
โ โโโ database/
โ โโโ history/
โ โโโ backups/
4๏ธโฃ Add Your Content
Create files in .buddy/
folders following the documentation below.
๐ง Available Tools
๐ buddy_get_rulesGet coding standards and guidelines
๐ buddy_search_knowledgeSearch project documentation
โ buddy_manage_todosList/update tasks and track progress
|
๐๏ธ buddy_get_database_infoGet schema info and validate queries
๐ buddy_historyTrack implementation changes and search history
๐พ buddy_backupCreate and manage file backups
|
๐ก Usage Examples
Ask your AI assistant questions like:
| ๐ฏ Category | ๐ฌ Example Questions | |----------------|-------------------------| | ๐ Coding Standards | "What are our coding standards for error handling?" | | โ Project Progress | "Show me current todos for the authentication feature" | | ๐ Documentation | "Search for API documentation about user endpoints" | | ๐๏ธ Database | "What's the database schema for the users table?" | | ๐ History | "How did we implement JWT authentication last month?" | | ๐ง Architecture | "What design patterns should I use for this feature?" |
๐ Documentation
๐ Rules Files
Location:
.buddy/rules/
Purpose: Define coding standards, architectural patterns, and guidelines
๐ Format Requirements
- โ
Use markdown format (
.md
) - โ
Include metadata:
category
andpriority
- โ Organize with clear sections and subsections
๐ง Example: Coding Standards
Click to expand coding standards example
# Coding Standards
- category: coding
- priority: critical
## Overview
Core coding standards and best practices for the project.
## Go-Specific Standards
- Follow Go naming conventions (camelCase, PascalCase)
- Use `gofmt` for code formatting
- Handle errors explicitly, don't ignore them
- Use interfaces for abstraction
## Error Handling
- Always check and handle errors
- Use structured error types
- Wrap errors with context using `fmt.Errorf`
- Return meaningful error messages
## Testing
- Write unit tests for all public functions
- Use table-driven tests for multiple test cases
- Achieve minimum 80% code coverage
๐๏ธ Example: Architecture Patterns
Click to expand architecture patterns example
# Architecture Patterns
- category: architecture
- priority: critical
## Design Principles
- **Single Responsibility**: Each component has one reason to change
- **Dependency Inversion**: Depend on abstractions, not concretions
## Recommended Patterns
### Repository Pattern
- Encapsulate data access logic
- Provide consistent interface for data operations
- Enable easy testing with mock implementations
### Layered Architecture
โโโโโโโโโโโโโโโโโโโโโโโ
โ Presentation โ โ HTTP handlers, CLI
โโโโโโโโโโโโโโโโโโโโโโโค
โ Business Logic โ โ Domain models, use cases
โโโโโโโโโโโโโโโโโโโโโโโค
โ Data Access โ โ Repositories, databases
โโโโโโโโโโโโโโโโโโโโโโโ
๐ Knowledge Files
Location:
.buddy/knowledge/
Purpose: Store project documentation, API specs, and technical information
๐ Format Requirements
- โ
Use markdown format (
.md
) - โ
Include metadata:
category
and optionaltags
- โ Structure with clear headings and examples
๐ Example: API Documentation
Click to expand API documentation example
# API Documentation
- category: architecture
- tags: api, rest, authentication
## Authentication Endpoints
### POST /auth/login
**Request:**
```json
{
"email": "user@example.com",
"password": "secure_password"
}
Response:
{
"token": "jwt_token_here",
"user": {
"id": 123,
"email": "user@example.com",
"role": "user"
}
}
GET /auth/me
Headers: Authorization: Bearer <token>
Response:
{
"user": {
"id": 123,
"email": "user@example.com",
"role": "user"
}
}
Error Handling
All endpoints return errors in this format:
{
"error": "error_code",
"message": "Human readable message"
}
</details>
---
### โ
Todo Files
> **Location:** `.buddy/todos/`
> **Purpose:** Track tasks, features, and project progress
#### ๐ Format Requirements
- โ
Use markdown format (`.md`)
- โ
Use checkbox syntax: `- [ ]` (incomplete) or `- [x]` (complete)
- โ
Group related tasks under clear headings
- โ
Include context and details for each task
#### ๐ Example: Feature Development
<details>
<summary>Click to expand feature development example</summary>
```markdown
# Authentication Feature
## Backend Implementation
- [x] Set up JWT library
- [x] Create user model and database migration
- [x] Implement password hashing with bcrypt
- [ ] Create login endpoint
- [ ] Create registration endpoint
- [ ] Add middleware for protected routes
- [ ] Write unit tests for auth service
- [ ] Add integration tests for auth endpoints
## Frontend Implementation
- [ ] Create login form component
- [ ] Create registration form component
- [ ] Implement JWT token storage
- [ ] Add authentication context
- [ ] Create protected route wrapper
- [ ] Handle token refresh logic
## Security & Testing
- [ ] Add rate limiting to auth endpoints
- [ ] Implement account lockout after failed attempts
- [ ] Add password strength validation
- [ ] Security audit of auth implementation
- [ ] Load testing for auth endpoints
๐๏ธ Database Files
Location:
.buddy/database/
Purpose: Store SQL schema definitions, migrations, and query examples
๐ Example: Schema Definition
Click to expand database schema example
-- Users table
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
password_hash VARCHAR(255) NOT NULL,
role VARCHAR(50) DEFAULT 'user',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Sessions table for JWT blacklisting
CREATE TABLE sessions (
id SERIAL PRIMARY KEY,
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
token_hash VARCHAR(255) UNIQUE NOT NULL,
expires_at TIMESTAMP NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Indexes for performance
CREATE INDEX idx_users_email ON users(email);
CREATE INDEX idx_sessions_token_hash ON sessions(token_hash);
CREATE INDEX idx_sessions_expires_at ON sessions(expires_at);
๐ Best Practices
| ๐ฏ Practice | ๐ Description |
|----------------|-------------------|
| ๐ Be Specific | Include concrete examples and code snippets |
| ๐ Stay Updated | Regularly review and update your files |
| ๐ Consistent Formatting | Follow the same structure across similar files |
| ๐ก Include Context | Add explanations for why rules or patterns exist |
| ๐ Link Information | Reference related files or external documentation |
| ๐ Version Control | Keep your .buddy
folder in version control |
| ๐ Regular Reviews | Schedule periodic reviews of your knowledge base |
๐ง Advanced Features
๐ File Monitoring
The server automatically monitors your .buddy
directory for changes and reloads content in real-time.
๐ Search Integration
Uses Bleve full-text search for fast, relevant results across all your project context.
๐พ Backup Management
Automatically creates backups of important files before modifications.
๐๏ธ Extensible Architecture
Built with Go for high performance and easy extension with new tools and features.
๐ค Contributing
We welcome contributions! Here's how you can help:
- ๐ Report Issues: Found a bug? Open an issue
- ๐ก Suggest Features: Have an idea? Start a discussion
- ๐ง Submit PRs: Ready to code? Fork, develop, and submit a pull request
- ๐ Improve Docs: Help us make the documentation better
๐ Ready to Get Started?
Your AI assistant will now have deep context about your codebase and can provide consistent, informed responses.
Made with โค๏ธ by developers, for developers