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 startedConnect your tool — no API key needed
Foremen supports MCP OAuth: point your tool at the endpoint and it opens a browser window to sign in with your Foremen account. One connection covers every project on your account. For Claude Code that's a single command:
claude mcp add --transport http foremen https://foremen.app/api/mcpCursor & VS Code
One-click deeplink, then sign in when prompted
claude.ai & ChatGPT
Add the endpoint URL as a connector and sign in
Tools that can't sign in can use an API key instead — see the per-tool sections below.
Verify it works
Ask your agent to call get_session_brief for your project. Your project page in the dashboard updates the moment Foremen receives its first call.
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
65 tools across 16 categories. All tools accept JSON arguments via the MCP protocol.
Project Management
(3)list_projectsList all projects in your Foremen account.
create_projectCreate a new project. Use when starting on a codebase that has no matching Foremen project yet. Returns the new id and slug.
Required
name(string)Human-readable project nameOptional (5)
description(string)Short description of what the project iscurrent_focus(string)What is being worked on now — tops every session briefrepo_url(string)URL of the code repositoryrepo_provider(string)Where the repository lives [github, gitlab, local]tech_stack(string[])Technologies used, seeded on creationget_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
(4)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_directivesCheck for directives — standing instructions the project owner wrote that should reach the working agent at specific moments. For tools without the automatic hook.
Required
project_id(string)The UUID or slug of the projectevent(string)The moment being checkedOptional (3)
session_id(string)Stable session id, so the same directive is not delivered twicefile_path(string)For post_tool_use: the file just editedprompt(string)For user_prompt: the user's request textcheck_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
(3)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)add_referenceCreate or update a reference — a prompt, design system, AI instruction set, or documentation — that other agents fetch by tag. The write half of get_reference.
Required
project_id(string)The UUID or slug of the projecttype(string)What kind of reference this istitle(string)Human-readable namereference_tag(string)The address other agents fetch this by. Matched partially, so make it distinctivecontent(string)The reference body, plain text or markdownOptional (2)
description(string)One line describing what this isattach_to(string)Tag or UUID of a parent referenceget_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
(12)add_documentWrite a document into a reference so agents can search it and pull single sections out. The write half of search_documents and get_document_section.
Required
project_id(string)The UUID or slug of the projectname(string)What this document is calledcontent(string)The document as markdown. Split into sections on # and ## headingsOptional (3)
reference_tag(string)The reference this belongs under. Partial match supportedreference_id(string)The parent reference's UUID, if known exactlysummary(string)One paragraph on what this document coverssearch_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 projectrename_projectRename a project. Changes only the display name by default — the slug stays put, because wired repos resolve against it.
Required
project_id(string)The UUID or slug of the projectname(string)The new display nameOptional (2)
new_slug(string)Explicit new slug. Breaks repos wired to the old one until re-initialised.update_slug(boolean)Derive a new slug from the new name (default: false)create_groupGroup related projects so they can see each other's decisions and lessons. A project can belong to several groups.
Required
name(string)Group name, e.g. "Shared Supabase Catalog"Optional (2)
description(string)What ties these projects togetherproject_ids(array)UUIDs or slugs to add immediatelylist_groupsList your project groups and which projects belong to each.
add_project_to_groupAdd a project to an existing group. Safe to call repeatedly.
Required
group(string)The UUID, slug, or exact name of the groupproject_id(string)The UUID or slug of the projectremove_project_from_groupRemove a project from a group. The project and its data are untouched.
Required
group(string)The UUID, slug, or exact name of the groupproject_id(string)The UUID or slug of the projectget_group_contextFull picture from sibling projects in the same group — decisions, lessons, open and completed tasks, recent activity, session notes. Call before touching anything shared.
Required
project_id(string)The project you are working on; its groups are found automaticallyOptional (2)
limit_per_project(number)Max rows of each kind per sibling (default: 10, max 25)include(array)Narrow to any of: decisions, lessons, tasks, activity, notes (default: all)Consultation
(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]Decisions
(3)add_decisionRecord a decision made during development. A one-liner is fine. Decisions surface in future session briefs so other agents know what was already settled.
Required
project_id(string)The UUID or slug of the projecttitle(string)Short name, e.g. 'REST not GraphQL'decision(string)The decision itself — one sentence is idealOptional (3)
context(string)Why it was made, what alternatives were consideredscope(string)Permanent, or temporary and auto-expiring [permanent, temporary]expires_at(string)ISO date a temporary decision expireslist_decisionsList active decisions. Expired temporary ones are filtered out automatically.
Required
project_id(string)The UUID or slug of the projectOptional (1)
include_expired(boolean)Include expired temporary decisionsdeprecate_decisionMark a decision as superseded. It stops appearing in session briefs.
Required
decision_id(string)The UUID of the decisionOptional (1)
reason(string)What superseded itArtifacts
(3)save_artifactKeep a working file past the end of the session that produced it — a rollback snapshot, generated SQL, a test harness. Text only, capped at 256KB.
Required
project_id(string)The UUID or slug of the projectname(string)File name as it was on diskcontent(string)The file's contents, verbatimOptional (3)
kind(string)What this is for [rollback, script, output, data, log, other]summary(string)One line on when someone would want itsession_id(string)Groups everything kept from one sessionlist_artifactsList working files kept from earlier sessions — what was saved, when, how big, what it was for. Metadata only.
Required
project_id(string)The UUID or slug of the projectOptional (3)
kind(string)Only artifacts of this kind [rollback, script, output, data, log, other]session_id(string)Only artifacts kept from this sessionlimit(number)Maximum to return (default 30)get_artifactRead one artifact back in full, by name or id. Find candidates with list_artifacts first — this returns the whole file.
Required
project_id(string)The UUID or slug of the projectOptional (3)
name(string)The artifact's file nameartifact_id(string)The artifact's UUID, when known exactlysession_id(string)Disambiguates the same name across sessionsSlot
(11)slot_connectConnect this session to a shared slot space using its 6-character code. One-time setup.
Required
code(string)The 6-character space code shown in the Slot web appslot_statusReport which slot space is connected, how many entries it holds, and what the current context is.
slot_contextGet the current slot context — the most recent deliberate capture. Call this when the user says 'check the slot' or refers to output they just sent.
Optional (2)
offset(integer)Start character for long contentlimit(integer)How many characters to returnslot_getRead one entry. Accepts a slot://SPACE/CLIP reference copied from the web app — read it immediately when one appears in the user's message — or a bare 4-character code.
Required
code(string)A slot://SPACE/CLIP reference, or a 4-character entry codeOptional (2)
offset(integer)Start character for long contentlimit(integer)How many characters to returnslot_listList recent entries with their 4-character codes and short previews.
Optional (4)
limit(integer)How many to return (default 20)kind(string)Filter by kind [text, image]since(string)ISO8601 — only entries created after thisspace(string)Read a named space instead of the connected oneslot_latestGet the most recent entry, optionally filtered to failed command captures. Answers 'what broke last?'
Optional (3)
kind(string)Filter by kind [text, image]failed_only(boolean)Only captures whose exit code was non-zerospace(string)Read a named space instead of the connected oneslot_putWrite into a slot. With `space`, this is how you message the person on the other end of a handoff — it lands on their open page immediately.
Required
content(string)The text to writeOptional (4)
label(string)Short human label for the entrykind(string)Entry kind [text, link]context(boolean)Mark this as the space's current contextspace(string)Write into a named space instead of the connected oneslot_waitWait for the other side to reply. Blocks up to 25 seconds and returns the moment something lands. Skips agent-written entries so you never answer yourself.
Optional (4)
space(string)The space to watch. Omit for the connected onesince(string)ISO8601 — pass back the value from a timed-out call to keep waitingtimeout_seconds(integer)How long to wait, 5 to 25 secondsinclude_agent(boolean)Also return agent-written entriesslot_handoffOpen a scratch slot for someone else and return every way of sending output into it, ready to forward: a browser link, a pipe-to-curl command, a file upload, and a one-line connect command for their own agent.
Optional (3)
purpose(string)What is being collected, e.g. 'the build error'recipient(string)Who the handoff is forspace(string)Reuse an existing space instead of opening a new oneslot_searchFull-text search across entries in the connected slot.
Required
query(string)What to search forOptional (1)
limit(integer)How many results to returnslot_deleteArchive one entry by its 4-character code. Soft delete — the code returns to the pool.
Required
code(string)The 4-character entry codeClient Updates
(8)create_client_updateCreate (or update) a client update from a Markdown spec and optionally publish and email it. Renders as a designed page at /updates/<slug>. One commit, one update.
Required
title(string)Update title; also the email subjectOptional (8)
id(string)Update an existing update instead of creating onesubtitle(string)Short line under the titleclient_name(string)Who the update is addressed torecipient_email(string)Where to send ittheme(string)Which visual theme to render inspec(string)Markdown body. A TUTORIAL line embeds a recorded walkthrough inline; 'TUTORIAL: tbd | name' holds an empty slot for one you have not recorded yetpublish(boolean)Publish the page as well as saving itsend(boolean)Email it once publishedsend_client_updateEmail a published update.
Required
id(string)The update to sendOptional (1)
email(string)Override the stored recipientcreate_onboarding_studyCreate or update a client-facing onboarding deliverable, such as a naming study, shared at /onboarding/<client_slug>/discover. Each step is a self-contained presentation page.
Required
client_name(string)Client's full name, shown on the pagesteps(object[])Ordered presentation steps. Put the primary recommendation firstOptional (4)
client_slug(string)URL slug for the share link. Derived from client_name if omittedtitle(string)Deliverable title (default 'Naming Discovery')prepared_on(string)Human-readable date shown in the headerthemes(object[])Optional look-and-feel phase shown after the client picks a namelist_tutorial_slotsList the places a walkthrough is meant to go. Open slots are what is left to record — the client sees nothing where they sit.
Optional (2)
update(string)Limit to one update, by id or sluginclude_filled(boolean)Also list slots that already hold a tutorialfill_tutorial_slotDrop a recorded tutorial into an open slot. The video appears where the slot was reserved — no re-authoring, no second link to send.
Required
tutorial(string)A /watch link, its token, or the tutorial idOptional (3)
update(string)Which update, by id or slugslot(string)Which slot, by handle or name. Omit when only one is opencaption(string)Optional line printed under the videolist_client_updatesList updates with their status, slug and published URL.
list_queued_updatesList updates waiting to be sent, so a week of work can go out as one note instead of five.
send_queued_updatesSend everything currently queued, together.
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. With just the URL, Cursor opens a browser to sign in (recommended):
{
"mcpServers": {
"foremen": {
"url": "https://foremen.app/api/mcp"
}
}
}Or authenticate with an API key instead:
{
"mcpServers": {
"foremen": {
"url": "https://foremen.app/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Connect to Claude Code
One command, no key — Claude Code opens a browser window to sign in with your Foremen account:
claude mcp add --transport http foremen https://foremen.app/api/mcpPrefer an API key (for CI or headless machines)? Pass it as a header:
claude mcp add --transport http foremen \
https://foremen.app/api/mcp \
--header "Authorization: Bearer YOUR_API_KEY"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. Without headers, VS Code runs the OAuth sign-in flow; add an Authorization header only if you want to use an API key instead:
{
"mcp": {
"servers": {
"foremen": {
"type": "http",
"url": "https://foremen.app/api/mcp"
}
}
}
}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 — ChatGPT will prompt you to sign in with your Foremen account (OAuth)
Save the connector. Foremen tools will appear in your ChatGPT sessions.
MCP Endpoint: https://foremen.app/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.
OAuth & API key authentication
Every MCP request requires a valid Bearer token — an OAuth token from signing in, or an API key. Keys are verified against a SHA-256 hash; a copy encrypted with your per-customer key lets you view them in the dashboard, and you can revoke them instantly.
API Reference
Endpoint
POST https://foremen.app/api/mcpAuthentication
All requests must include a Bearer token in the Authorization header — either an OAuth access token (unauthenticated requests get a 401 with OAuth discovery metadata, so MCP clients handle sign-in automatically) or an API key from the 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 |