The MCP server automatically detects which CodeFire project you’re working on based on your current working directory when the AI CLI tool starts.How it works:
The MCP server reads the working directory from your shell environment
It queries the CodeFire database for projects matching that path
It falls back to parent directory matching (so /path/to/project/src matches /path/to/project)
If a match is found, that project becomes the default project for the session
Example:
# Navigate to a project directorycd ~/projects/my-web-app# Start your AI toolclaude# Ask the agent to check which project was detected"What CodeFire project am I working on?"# Agent calls: get_current_project# Returns: "Current project: my-web-app (ID: abc123)"
Benefits:
You can omit project_id from most tool calls
The agent automatically works with the correct project
No manual configuration needed per session
When auto-detection fails:If you’re working in a directory that isn’t tracked by CodeFire, you’ll see:
No project detected for working directory: /Users/you/random-folderUse list_projects to find the correct project_id and pass it explicitly.
To fix this:
Add the project to CodeFire (open the GUI and add the folder)
Or, explicitly pass project_id to each tool call
Or, cd into a directory that matches a tracked project
CodeFire supports both project-specific and global tasks and notes:
Scope
Description
When to Use
Project
Data tied to a specific project
Most development tasks, project-specific context
Global
Data visible on the home board, not tied to any project
Cross-project tasks, personal reminders, general planning
To work with global data, set global: true in tool calls:
# Create a global task"Create a global task to review billing settings"# Agent calls: create_task({ title: "Review billing", global: true })# List global tasks"Show me all global planner tasks"# Agent calls: list_tasks({ global: true })# Create a global note"Create a global note with my weekly goals"# Agent calls: create_note({ title: "Weekly Goals", content: "...", global: true })
When you begin a new coding session, help your AI agent get oriented:
You: What CodeFire project am I working on? Show me all in-progress tasks.Agent:- Calls: get_current_project- Calls: list_tasks({ status: "in_progress" })Output:Current project: my-web-app (ID: abc123)In-progress tasks (3): #42 [in_progress] (high) Implement user authentication #38 [in_progress] (medium) Add dark mode support #29 [in_progress] (low) Update README
Now the agent knows exactly what you’re working on and can reference these tasks throughout the session.
As you discover bugs or ideas, create tasks on the fly:
You: I found a bug in the login form validation. Create a high-priority task for it.Agent:- Calls: create_task({ title: "Fix login form validation bug", priority: 3, labels: ["bug", "frontend"], description: "Login form accepts invalid email formats" })Output:Created task #47: Fix login form validation bug
The task immediately appears in CodeFire’s task board. You can triage it later or assign it to yourself.
Use task notes to create an audit trail of your work:
You: Add a note to task #42 explaining that I discovered the auth issue is in the middleware, not the controller.Agent:- Calls: add_task_note({ task_id: 42, content: "Discovered the auth issue is in the middleware (src/middleware/auth.ts), not the controller. The JWT verification is failing silently." })Output:Added note to task #42
Later, you or another developer can review the task notes to understand the investigation process.
Use project notes to document important decisions:
You: Create a pinned note titled "API Design Decisions" explaining why we chose REST over GraphQL.Agent:- Calls: create_note({ title: "API Design Decisions", content: "We chose REST over GraphQL for this project because:\n1. Simpler caching with HTTP\n2. Team is more familiar with REST\n3. Our use case doesn't require complex nested queries", pinned: true })Output:Created note #8: API Design Decisions
Pinned notes appear at the top of the notes list in CodeFire, making them easy to reference.
Before starting work, search notes for relevant context:
You: Search notes for "authentication" to see if we have any existing documentation.Agent:- Calls: search_notes({ query: "authentication" })Output:Search results for 'authentication' (2): #12 [pinned] Auth Flow Documentation Detailed flow: User submits credentials → API validates → JWT issued → Client stores... #7 Third-Party Auth Integration We evaluated Auth0 and Firebase. Chose Firebase because it integrates better with our...
Now the agent can read these notes and incorporate that context into its responses.
You: Navigate to localhost:3000, take a screenshot, then click the login button and check if the form appears.Agent:- Calls: browser_navigate({ url: "http://localhost:3000" })- Calls: browser_screenshot()- Calls: browser_snapshot()- Calls: browser_click({ ref: "e12" }) // ref for login button from snapshot- Calls: browser_wait({ selector: "form#login" })- Calls: browser_snapshot()Output:Screenshot saved to: /tmp/screenshot-123.pngLogin form is now visible with fields: email, password, and a "Sign In" button.
The agent can visually verify your app is working correctly.
Manage git operations without leaving your AI session:
You: Show me the git status, then stage all changes and commit them with message "Add login validation".Agent:- Calls: git_status()- Calls: git_stage() // omit file_path to stage all- Calls: git_commit({ message: "Add login validation" })Output:Branch: feature/authStaged: src/components/LoginForm.tsx, src/utils/validation.tsCommit created: a3f2b1c
Find relevant code without knowing exact file names:
You: Find all functions that handle user registration.Agent:- Calls: context_search({ query: "user registration", types: ["function"] })Output:Found 3 matches: 1. registerUser() in src/api/auth.ts:45-67 2. createUserAccount() in src/services/user.ts:12-34 3. validateRegistrationData() in src/utils/validation.ts:89-102
The agent can now read those functions and understand your registration flow.
You: Generate a 16:9 hero image of a modern office workspace with warm lighting.Agent:- Calls: generate_image({ prompt: "modern office workspace with warm lighting, professional photography, high quality", aspect_ratio: "16:9", size: "2K" })Output:Image generated: /Users/you/projects/my-app/assets/generated/image-2026-03-04-1234.png
The image is saved to your project and tracked in the CodeFire database.
Before creating a new note, search to see if one already exists:
You: Search notes for "deployment" to see if we have existing documentation.Agent:- Calls: search_notes({ query: "deployment" })Output:Found note #15: Deployment ChecklistYou: Great, update note #15 with the new Vercel configuration steps.Agent:- Calls: get_note({ note_id: 15 })- Calls: update_note({ note_id: 15, content: "...updated content..." })
1. Create a task for the feature2. Ask the agent to implement it3. Add task notes documenting decisions4. Use git tools to stage and commit changes5. Mark the task as done6. Create a project note if the feature introduced new patterns
Example:
You: Implement user profile editing. Create a task, build it, commit the changes, and mark it done.Agent:- create_task({ title: "Implement user profile editing", priority: 2 })- [writes code]- add_task_note({ content: "Used form validation library Zod for type-safe schema validation" })- git_stage()- git_commit({ message: "Add user profile editing with Zod validation" })- update_task({ status: "done" })
1. Create a bug task2. Search codebase for relevant functions (context_search)3. Add notes to the task explaining findings4. Fix the bug5. Add a final note explaining the solution6. Mark the task as done
Example:
You: There's a bug where users can submit the form twice. Investigate and fix it.Agent:- create_task({ title: "Fix double form submission bug", priority: 3, labels: ["bug"] })- context_search({ query: "form submission" })- add_task_note({ content: "Found the issue in src/components/Form.tsx - no disabled state on submit" })- [fixes code]- add_task_note({ content: "Fixed by adding loading state and disabling button during submission" })- git_commit({ message: "Fix double form submission by disabling button" })- update_task({ status: "done" })
1. Search notes for existing documentation2. If none exists, research the topic3. Create a pinned note with findings4. Reference this note in future sessions
Example:
You: Research best practices for API rate limiting and document them.Agent:- search_notes({ query: "rate limiting" }) → No results found- [researches topic]- create_note({ title: "API Rate Limiting Best Practices", content: "1. Use token bucket algorithm\n2. Return 429 status with Retry-After header\n3. Implement per-user and per-IP limits...", pinned: true })You (next session): How should I implement rate limiting?Agent:- search_notes({ query: "rate limiting" }) → Found note #23: API Rate Limiting Best Practices- [reads note and provides answer based on documented practices]
Cause: The CodeFire app hasn’t been launched yet, so the database doesn’t exist.Solution: Open the CodeFire app at least once to initialize the database.