Skip to content

Commit 40510c0

Browse files
author
yasinboelhouwer
committed
Initial commit: CursorFlow MCP Server
1 parent 4f5e502 commit 40510c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+16477
-3259
lines changed

.env.example

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Server Configuration
2+
PORT=3002
3+
HOST=localhost
4+
5+
# Authentication
6+
AUTH_TOKEN=your-secret-token
7+
8+
# Data Storage
9+
DATA_DIR=./data
10+
MEMORY_BANK_DIR=./data/memory-bank
11+
WORKFLOWS_DIR=./data/workflows
12+
MODES_DIR=./data/modes
13+
14+
# Logging
15+
LOG_LEVEL=info
16+
17+
# Performance
18+
ENABLE_CACHE=true
19+
20+
# Database (optional)
21+
USE_DATABASE=false
22+
DATABASE_PATH=./data/cursorflow.db
23+
24+
# Memory Bank Configuration
25+
MAX_HISTORY_VERSIONS=10
26+
27+
# Mode Configuration
28+
MODES_PATH=./.cursor
29+
30+
# Workflow Configuration
31+
WORKFLOWS_PATH=./workflows

.eslintrc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
env: {
3+
node: true,
4+
es2021: true,
5+
jest: true,
6+
},
7+
extends: ['eslint:recommended'],
8+
parserOptions: {
9+
ecmaVersion: 'latest',
10+
sourceType: 'module',
11+
},
12+
rules: {
13+
'no-console': 'off', // Allow console for server logging
14+
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
15+
'semi': ['error', 'always'],
16+
'quotes': ['error', 'single'],
17+
'indent': ['error', 2],
18+
'comma-dangle': ['error', 'always-multiline'],
19+
'eol-last': ['error', 'always'],
20+
},
21+
};

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Create data directories
30+
run: |
31+
mkdir -p data/memory-bank
32+
mkdir -p data/workflows
33+
mkdir -p data/modes
34+
35+
- name: Run tests
36+
run: npm test
37+
38+
- name: Check for linting errors
39+
run: npm run lint
40+
if: ${{ always() }}

.gitignore

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
1-
memory-bank/
1+
# Dependency directories
2+
node_modules/
3+
.npm/
4+
5+
# Runtime data
6+
logs/
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
pids
12+
*.pid
13+
*.seed
14+
*.pid.lock
15+
16+
# Environment variables
17+
.env
18+
.env.local
19+
.env.development.local
20+
.env.test.local
21+
.env.production.local
22+
23+
# Testing
24+
coverage/
25+
temp-test/
26+
27+
# Build outputs
28+
dist/
29+
build/
30+
out/
31+
32+
# IDE/Editor folders
33+
.idea/
34+
.vscode/
35+
*.swp
36+
*.swo
37+
.DS_Store
38+
39+
# Project specific
40+
.cursor/
241
dev/
3-
.vscode
4-
.roomodes
5-
.roo/
42+
43+
# Keep data structure but not contents
44+
data/memory-bank/*
45+
!data/memory-bank/.gitkeep
46+
data/workflows/*
47+
!data/workflows/.gitkeep
48+
data/modes/*
49+
!data/modes/.gitkeep

CONTRIBUTING.md

Lines changed: 56 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,76 @@
1-
# Contributing to RooFlow
1+
# Contributing to CursorFlow MCP Server
22

3-
Thank you for your interest in contributing to RooFlow! We welcome contributions from everyone. This document outlines how to contribute to the project.
3+
Thank you for considering contributing to the CursorFlow MCP Server! This document provides guidelines and instructions for contributing to this project.
44

5-
## Ways to Contribute
5+
## Code of Conduct
66

7-
* **Bug Reports:** If you find a bug, please open an issue on the GitHub repository, providing a clear description of the problem, steps to reproduce it, and your expected vs. actual results. Include the Roo version, VS Code version, and operating system.
8-
* **Feature Requests:** If you have an idea for a new feature, open an issue on GitHub and describe the feature, its benefits, and any potential implementation details.
9-
* **Code Contributions:** If you want to contribute code (bug fixes, new features, improvements), please follow these steps:
10-
1. **Fork the Repository:** Create a fork of the RooFlow repository on GitHub.
11-
2. **Create a Branch:** Create a new branch for your changes (e.g., `feature/my-new-feature` or `bugfix/issue-123`). Use descriptive branch names.
12-
3. **Make Changes:** Make your changes, following the coding style and conventions of the project.
13-
4. **Test Thoroughly:** Ensure your changes work correctly and don't introduce new issues. Test with and without an existing Memory Bank. Test the UMB command.
14-
5. **Commit Changes:** Commit your changes with clear and descriptive commit messages.
15-
6. **Push to Your Fork:** Push your branch to your forked repository.
16-
7. **Create a Pull Request:** Create a pull request from your branch to the `main` branch of the RooFlow repository. Clearly describe your changes and the problem they solve or the feature they add.
17-
* **Documentation:** Improvements to the documentation (README, etc.) are also welcome. Follow the same process as for code contributions.
7+
By participating in this project, you agree to maintain a respectful and inclusive environment for everyone.
188

19-
## Development Setup
9+
## How Can I Contribute?
2010

21-
To develop RooFlow, you'll need:
11+
### Reporting Bugs
2212

23-
1. **VS Code:** Install Visual Studio Code.
24-
2. **Roo Code Extension:** Install the Roo Code extension from the VS Code Marketplace.
25-
3. **Git:** Install Git for version control.
26-
4. **Node.js and npm (likely):** While RooFlow itself doesn't have *code* in the traditional sense, the Roo Code extension likely uses Node.js and npm for its build process. If you're modifying the `system-prompt-[mode]` files, you *might* need to rebuild the extension. Check the Roo Code documentation for specific instructions.
13+
When reporting bugs, please include:
14+
- A clear and descriptive title
15+
- Steps to reproduce the issue
16+
- Expected behavior
17+
- Actual behavior
18+
- Screenshots (if applicable)
19+
- Environment details (OS, Node.js version, etc.)
2720

28-
**Project Structure:**
21+
### Suggesting Enhancements
2922

30-
The RooFlow project consists of the following files, which you should place in your project's root directory:
23+
Enhancement suggestions are also welcome. Please include:
24+
- A clear and descriptive title
25+
- A detailed description of the proposed enhancement
26+
- Any potential implementation details (if you have ideas)
27+
- Why this enhancement would be useful to most users
3128

32-
* `.clinerules-architect`: Defines the behavior of Architect mode.
33-
* `.clinerules-code`: Defines the behavior of Code mode.
34-
* `.clinerules-debug`: Defines the behavior of Debug mode.
35-
* `.clinerules-ask`: Defines the behavior of Ask mode.
36-
* `.clinerules-test`: Defines the behavior of Test mode.
37-
* `.roo/`: A directory containing the system prompts.
38-
* `system-prompt-architect`: System prompt for Architect mode.
39-
* `system-prompt-code`: System prompt for Code mode.
40-
* `system-prompt-debug`: System prompt for Debug mode.
41-
* `system-prompt-ask`: System prompt for Ask mode.
42-
* `system-prompt-test`: System prompt for Test mode.
43-
* `.roomodes`: Defines custom modes.
44-
* `README.md`: This file.
45-
* `projectBrief.md`: Optional project brief.
29+
### Pull Requests
4630

47-
**Memory Bank:**
31+
1. Fork the repository
32+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
33+
3. Make your changes
34+
4. Run tests to ensure they pass (`npm test`)
35+
5. Commit your changes (`git commit -m 'Add some amazing feature'`)
36+
6. Push to the branch (`git push origin feature/amazing-feature`)
37+
7. Open a Pull Request
4838

49-
The `memory-bank/` directory is created automatically by RooFlow. Do *not* create it manually.
39+
## Development Setup
5040

51-
**Testing:**
41+
1. Clone your fork of the repository
42+
2. Install dependencies: `npm install`
43+
3. Create your `.env` file based on `.env.example`
44+
4. Start the server in development mode: `npm run dev`
5245

53-
* **Test Thoroughly:** Before submitting any changes, test them thoroughly in various scenarios.
54-
* **Memory Bank Presence/Absence:** Test with and without an existing Memory Bank.
55-
* **UMB Command:** Test the "Update Memory Bank" (UMB) command to ensure it works correctly.
56-
* **Mode Switching:** Test switching between different modes.
57-
* **Error Handling:** Test how RooFlow handles errors and unexpected situations.
46+
## Coding Guidelines
5847

59-
## Coding Style
48+
- Follow the existing code style
49+
- Write unit tests for new features
50+
- Update documentation for any changes to the API or features
51+
- Keep pull requests focused on a single feature or bug fix
6052

61-
* **YAML:** The `.clinerules-[mode]` and `system-prompt-[mode]` files use YAML format. Use consistent indentation (2 spaces) and follow YAML best practices.
62-
* **Markdown:** The Memory Bank files (`.md`) use Markdown format.
63-
* **Clarity:** Write clear, concise, and unambiguous instructions.
64-
* **Comments**: Use comments within the YAML files to explain complex logic.
53+
## Commit Messages
6554

66-
## Pull Request Guidelines
55+
- Use the present tense ("Add feature" not "Added feature")
56+
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
57+
- Limit the first line to 72 characters or less
58+
- Reference issues and pull requests in the commit message
6759

68-
* **Descriptive Title:** Use a clear and descriptive title for your pull request.
69-
* **Detailed Description:** Provide a detailed description of your changes, including the motivation for the changes, the approach taken, and any relevant context.
70-
* **Link to Issue:** If your pull request addresses an existing issue, link to the issue in the description.
71-
* **Small, Focused Changes:** Prefer smaller, focused pull requests over large, monolithic ones.
72-
* **Tests:** Include tests for any new functionality or bug fixes.
60+
## Documentation
7361

74-
## Code of Conduct
62+
If your changes affect how users interact with the project, please update the README.md file accordingly.
63+
64+
## Testing
65+
66+
Please ensure all tests pass before submitting a pull request:
67+
68+
```bash
69+
npm test
70+
```
71+
72+
For new features, please add appropriate tests to ensure functionality.
7573

76-
Please be respectful and constructive in all interactions.
74+
## License
7775

78-
By contributing to RooFlow, you agree to abide by the terms of the [Apache 2.0 License](LICENSE).
76+
By contributing to this project, you agree that your contributions will be licensed under the project's [MIT License](LICENSE).

Dockerfile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# CursorFlow MCP Server Dockerfile
2+
# Multi-stage build for optimized production image
3+
4+
# Build stage
5+
FROM node:18-alpine AS build
6+
7+
# Set working directory
8+
WORKDIR /usr/src/app
9+
10+
# Copy package files
11+
COPY package*.json ./
12+
13+
# Install dependencies
14+
RUN npm ci --only=production
15+
16+
# Copy source code
17+
COPY . .
18+
19+
# Create data directories
20+
RUN mkdir -p /usr/src/app/data/memory-bank
21+
RUN mkdir -p /usr/src/app/data/workflows
22+
RUN mkdir -p /usr/src/app/data/modes
23+
24+
# Production stage
25+
FROM node:18-alpine
26+
27+
# Set environment variables
28+
ENV NODE_ENV=production
29+
ENV PORT=3000
30+
ENV HOST=0.0.0.0
31+
ENV DATA_DIR=/data
32+
ENV MEMORY_BANK_DIR=/data/memory-bank
33+
ENV WORKFLOWS_DIR=/data/workflows
34+
ENV MODES_DIR=/data/modes
35+
ENV LOG_LEVEL=info
36+
37+
# Create app directory
38+
WORKDIR /usr/src/app
39+
40+
# Copy from build stage
41+
COPY --from=build /usr/src/app/node_modules ./node_modules
42+
COPY --from=build /usr/src/app/src ./src
43+
COPY --from=build /usr/src/app/public ./public
44+
COPY --from=build /usr/src/app/package*.json ./
45+
46+
# Create data directories
47+
RUN mkdir -p /data/memory-bank
48+
RUN mkdir -p /data/workflows
49+
RUN mkdir -p /data/modes
50+
51+
# Add a non-root user
52+
RUN addgroup -g 1001 -S cursorflow && \
53+
adduser -u 1001 -S cursorflow -G cursorflow
54+
55+
# Set ownership
56+
RUN chown -R cursorflow:cursorflow /usr/src/app
57+
RUN chown -R cursorflow:cursorflow /data
58+
59+
# Switch to non-root user
60+
USER cursorflow
61+
62+
# Expose port
63+
EXPOSE 3000
64+
65+
# Health check
66+
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
67+
CMD wget -qO- http://localhost:3000/health || exit 1
68+
69+
# Run the application
70+
CMD ["node", "src/index.js"]

0 commit comments

Comments
 (0)