Documentation
Everything you need to connect your AI coding tools to Foremen and give your agents persistent project memory.
Quickstart
Get up and running in under two minutes.
Sign up and create a project
Create a free account, then create a project. A project maps to one codebase. You will get an API key automatically.
Get startedCopy your API key
Your API key is shown once during onboarding. Copy it and keep it safe. You can create additional keys anytime from Settings.
Connect your tool
Use a one-click deeplink or add the MCP server manually. Foremen works with any tool that supports MCP.
Cursor
One-click deeplink installs Foremen as an MCP server
VS Code
Deeplink or add to settings.json manually
Claude Code
One CLI command to add the MCP server
Windsurf
One-click deeplink via MCP registry
Concepts
The core abstractions in Foremen.
Projects
A project maps to one codebase. It holds all the context your agents need: architecture, lessons, tasks, guardrails, and session history. Agents can reference projects by UUID or slug.
Session Briefs
A single-call briefing that assembles everything an agent needs at session start: current task, recent session notes, lessons learned, active decisions, architecture state, and auto-resolved references.
Lessons
Patterns learned from debugging, development, or discovery. Each lesson captures what to watch for (pattern), what goes wrong if ignored (impact), and how to fix it. Surfaced automatically in future briefs.
Decisions
Architectural and technical decisions with context and rationale. Decisions can be permanent or temporary with expiration dates. Active decisions appear in session briefs so agents respect them.
Guardrails
Protection rules that prevent agents from touching sensitive files, directories, or components. Guardrails have severity levels: info, warning, critical, and blocked. The consult tool checks them automatically.
Architecture
A living map of your system's components. Each component has a name, type (frontend, backend, database, etc.), status, and description. Agents update this as they build features.
Session Notes
Append-only, timestamped notes that persist across chat sessions. Agents use these to leave breadcrumbs: progress updates, decisions made, blockers hit, or context the next session needs.
Check-in / Check-out
Lightweight agent coordination. Check-in registers what an agent is working on and which files it will touch. Check-out records what was accomplished. Used for conflict detection when multiple agents work on the same project.
MCP Tools Reference
30 tools across 12 categories. All tools accept JSON arguments via the MCP protocol.
Project Management
(2)list_projectsList all projects in your Foremen account.
get_current_focusGet the current focus/task for a project.
Required
project_id(string)The UUID or slug of the projectSession
(3)get_session_briefGet a comprehensive pre-session briefing. Call this at the START of every new chat session. Returns project overview, current focus, session notes, current/next task with full prompt, auto-resolved references, lessons, decisions, architecture, and recent activity.
Required
project_id(string)The UUID or slug of the projectadd_session_noteWrite a note that persists across chat sessions. Use this to leave breadcrumbs for the next agent/chat.
Required
project_id(string)The UUID or slug of the projectcontent(string)The note content. Be specific — include what was done, what's left, any gotchas.Optional (1)
metadata(object)Optional structured metadata (e.g. { task_id, files_touched })get_session_notesRead session notes for a project. Returns the most recent notes left by previous agents/chats.
Required
project_id(string)The UUID or slug of the projectOptional (1)
limit(number)Max number of notes to return (default 20)Tasks
(5)get_tasksGet the to-do list for a project. Each task has a prompt with instructions for what to do.
Required
project_id(string)The UUID or slug of the projectOptional (1)
status(string)Filter by status [pending, in_progress, completed, skipped]get_next_taskGet the next pending task to work on. Returns the highest priority pending task with its prompt.
Required
project_id(string)The UUID or slug of the projectstart_taskMark a task as in_progress when you begin working on it.
Required
task_id(string)The UUID of the taskcomplete_taskMark a task as completed. If the task has requires_new_chat=true, the agent will tell the user to start a new chat.
Required
task_id(string)The UUID of the taskOptional (1)
summary(string)Brief summary of what was doneadd_taskAdd a new task to the project's to-do list.
Required
project_id(string)The UUID or slug of the projecttitle(string)Short title for the taskprompt(string)The full prompt/instructions for the AI to execute this taskOptional (3)
description(string)Human-readable descriptionpriority(number)Priority (higher = more important, default 0)requires_new_chat(boolean)Whether to suggest starting a new chat after this taskKnowledge
(2)learn_lessonRecord a lesson learned from debugging, development, or discovery. Stores the pattern to watch for, the impact, and the fix. Lessons are surfaced in future session briefs.
Required
project_id(string)The UUID or slug of the projecttitle(string)Short name for the lesson (e.g. 'OAuth tokens expire after 1hr')pattern(string)What to watch for — describe the pattern conceptuallyOptional (7)
impact(string)What goes wrong if this is ignoredfix(string)How to solve or avoid the problemorigin_file(string)File path where the fix was madeorigin_before(string)Code snippet before the fixorigin_after(string)Code snippet after the fixorigin_description(string)Description of the code changetags(string[])Searchable tags (e.g. ['auth', 'github'])get_lessonsGet lessons learned for a project. Returns patterns, impacts, fixes, and code origins. Use this when debugging or before making changes.
Required
project_id(string)The UUID or slug of the projectOptional (2)
tag(string)Filter lessons by tag (e.g. 'auth', 'database')query(string)Search lessons by keyword in title, pattern, or fixArchitecture
(1)update_architectureAdd or update a component in the project's architecture. If a component with the same name exists, it will be updated.
Required
project_id(string)The UUID or slug of the projectname(string)Name of the component (e.g. 'Cart API', 'Auth Service')Optional (3)
type(string)Type of component [frontend, backend, database, external, service]description(string)What this component does, key files, and how it connectsstatus(string)Current status [planned, in-progress, done]Agent Coordination
(3)check_inCall at the start of a work session. Registers what you're about to work on so other tools can see active work and avoid conflicts.
Required
project_id(string)The UUID or slug of the projectwork_description(string)One sentence: what you're about to doOptional (2)
files_involved(string[])File paths you expect to touchtool(string)Which tool is working (e.g. 'claude-code', 'cursor')check_outCall when done working. Records what was accomplished briefly.
Required
project_id(string)The UUID or slug of the projectsummary(string)One sentence: what you didOptional (3)
files_created(string[])Files created during this sessionfiles_modified(string[])Files modified during this sessiontask_id(string)If working on a specific task, mark it donecheck_conflictsBefore modifying files, check if another agent recently touched them. Returns recent activity within the last 2 hours.
Required
project_id(string)The UUID or slug of the projectfiles(string[])File paths you plan to modifyGuardrails
(3)add_guardrailAdd a guardrail to protect a file, directory, or component from accidental modification.
Required
project_id(string)The UUID or slug of the projecttarget_type(string)What type of thing is being protectedtarget_path(string)The path or name to protectmessage(string)The warning message to showOptional (2)
severity(string)How severe the guardrail is [info, warning, critical, blocked]reason(string)Detailed explanationget_guardrailsGet all active guardrails for a project. Call this before making changes.
Required
project_id(string)The UUID or slug of the projectOptional (1)
check_path(string)Check if a specific path matches any guardrailsremove_guardrailRemove a guardrail by ID.
Required
guardrail_id(string)The UUID of the guardrail to removeReferences
(2)list_referencesList all references (prompts, style guides, AI instructions) for a project.
Required
project_id(string)The UUID or slug of the projectOptional (2)
type(string)Filter by type [prompt, style_guide, ai_instructions]tag(string)Search by reference tag (partial match)get_referenceGet a specific reference by ID or tag. Returns full content including uploaded files and all attached references auto-resolved.
Required
project_id(string)The UUID or slug of the projectOptional (2)
reference_id(string)The UUID of the referencereference_tag(string)The reference tag to search forDocuments
(5)search_documentsSearch across all processed documents in a project by keyword or query. Returns matching sections with titles and tags.
Required
project_id(string)The UUID or slug of the projectquery(string)Search query — keywords or natural languageOptional (1)
reference_id(string)Scope search to documents attached to a specific referenceget_document_sectionFetch a specific section from a processed document by title or index.
Required
document_id(string)The UUID of the documentOptional (2)
section_title(string)Title of the section to fetch (partial match)section_index(number)Zero-based index of the sectionfind_relevant_docsGiven a task description or question, searches all project references and documents to find the most relevant ones.
Required
project_id(string)The UUID or slug of the projectquery(string)Description of what you're working onexpand_promptExpands a prompt reference by inlining all attached documents, linked references, and optionally project context. Returns a fully-resolved prompt.
Required
reference_id(string)The UUID of the reference (prompt) to expandOptional (1)
include_project_context(boolean)Include full project context in the expanded prompt (default: false)sync_projectRe-scan a GitHub-connected project to sync tech stack, components, and references from the repository.
Required
project_id(string)The UUID or slug of the projectConsultation
(1)consult_foremenAsk Foremen for a second opinion on a decision or action. Checks guardrails, lessons, architecture, and project history to give an informed recommendation.
Required
project_id(string)The UUID or slug of the projectquestion(string)The question or decision you need help withOptional (3)
context(string)Additional context about what you're trying to accomplishfiles_involved(string[])List of file paths that might be affectedproposed_action(string)What you're planning to doConversations
(2)import_chatImport and process a raw chat export from Claude, ChatGPT, Cursor, or any AI tool. Parses the conversation and extracts decisions, Q&A, and key moments with anchor links.
Required
project_id(string)The UUID or slug of the projectchat_content(string)The raw chat transcriptOptional (5)
source(string)Which AI tool the chat came from [claude, chatgpt, cursor, copilot, other]title(string)Title for this conversationcommit_hash(string)Git commit hash to link tofiles_involved(string[])Files that were discussed or modifiedsession_id(string)Link to an agent sessionsearch_conversationsSearch past imported conversations for decisions, Q&A, problems, solutions, and insights.
Required
project_id(string)The UUID or slug of the projectquery(string)What to search forOptional (3)
chunk_type(string)Filter to specific chunk types [decision, question, problem, solution, insight, warning, todo, reference]file_path(string)Filter to conversations mentioning a specific filelimit(number)Max results to return (default 15)Activity
(1)report_activityReport what you just did in a coding session — files created, modified, summary of work.
Required
project_id(string)The UUID or slug of the projectsummary(string)Brief summary of what was doneOptional (5)
type(string)Type of activity [implementation, fix, refactor, docs, other]component(string)Name of the component worked onfiles_created(string[])List of files createdfiles_modified(string[])List of files modifiedstatus_change(string)Status change for the component [started, in_progress, completed, blocked]Connect to Cursor
Option 1: One-click install
During onboarding, Foremen generates a deeplink that installs the MCP server directly into Cursor. Click the button and Cursor will open with Foremen pre-configured.
Cursor Deeplink
cursor://anysphere.cursor-deeplink/mcp/install?name=foremen&config=...
Option 2: Manual configuration
Add Foremen to your .cursor/mcp.json file in your project root:
{
"mcpServers": {
"foremen": {
"url": "https://your-foremen-instance.com/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Connect to Claude Code
Run a single CLI command to add Foremen as an MCP server:
claude mcp add --transport http foremen \
https://your-foremen-instance.com/api/mcp \
--header "Authorization: Bearer YOUR_API_KEY"Replace the URL and API key with your actual values from the Foremen dashboard.
Connect to VS Code
Option 1: One-click install
Use the VS Code deeplink from the Foremen onboarding flow. It opens VS Code and adds the MCP server to your configuration automatically.
VS Code Deeplink
vscode:mcp/install?...
Option 2: Manual configuration
Add to your VS Code settings.json:
{
"mcp": {
"servers": {
"foremen": {
"type": "http",
"url": "https://your-foremen-instance.com/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
}Connect to ChatGPT
ChatGPT supports MCP servers via the Connectors feature.
Open ChatGPT and go to Settings
Navigate to Connectors and click Create
Enter the Foremen MCP endpoint URL
Add your API key as a Bearer token in the authentication section
Save the connector. Foremen tools will appear in your ChatGPT sessions.
MCP Endpoint: https://your-foremen-instance.com/api/mcp
Security
Per-customer encryption
Every customer's data is encrypted with their own unique key. We cannot read your data. If you revoke access, your data becomes permanently unreadable.
Row-level security
Every database query is scoped to your user. No customer can access another customer's data, even through the API.
No code stored
Foremen stores project context — architecture, lessons, decisions — but never your source code. Your code stays in your repos.
Encrypted at rest
All data is encrypted at rest using industry-standard encryption. Data in transit is always TLS-encrypted.
API key authentication
Every MCP request requires a valid Bearer token. Keys are hashed before storage. You can revoke keys instantly from the dashboard.
API Reference
Endpoint
POST https://your-foremen-instance.com/api/mcpAuthentication
All requests must include a Bearer token in the Authorization header. Get your API key from the Foremen dashboard.
Authorization: Bearer your_api_key_hereProtocol
Foremen uses the JSON-RPC 2.0 protocol over HTTP, as specified by the Model Context Protocol (MCP). The server supports Streamable HTTP transport.
Supported protocol versions: 2025-11-25, 2025-03-26, 2024-11-05
Example: Initialize
// Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-03-26",
"clientInfo": {
"name": "my-client",
"version": "1.0.0"
},
"capabilities": {}
}
}
// Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2025-03-26",
"capabilities": {
"tools": { "listChanged": false }
},
"serverInfo": {
"name": "monolink",
"version": "0.1.0"
}
}
}Example: Call a tool
// Request
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "get_session_brief",
"arguments": {
"project_id": "my-project-slug"
}
}
}
// Response
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"content": [
{
"type": "text",
"text": "# Session Brief: my-project\n\n..."
}
]
}
}Session management
The server returns a Mcp-Session-Id header after initialization. Include this header in subsequent requests. Sessions expire after 24 hours.
Error codes
| Code | Meaning |
|---|---|
| -32700 | Parse error — invalid JSON |
| -32601 | Method not found |
| -32000 | Unauthorized — invalid or missing API key |
| 401 | HTTP authentication required (triggers OAuth flow) |
| 404 | Invalid or expired session |