Feat/mcp server#1
Merged
Merged
Conversation
- Introduced ApiKeyPanel component for managing API keys. - Updated TopBar to include a button for opening the API key management panel. - Enhanced useDocument hook to track SSE ticks. - Modified DocumentPage to pass SSE tick to EditorLayout. - Added API key types and responses to types/index.ts. - Implemented API functions for creating, listing, and revoking API keys. - Created Dockerfile and README for the new MCP server. - Developed the MCP server with tools for AI agents to interact with DocForge documents. - Added comprehensive tool reference documentation for MCP server.
Remove the stdio entry point and DOCFORGE_API_KEY env-var fallback — the server is HTTP-only. Add `docforge_mcp/resources/` with a system-prompt guide and three workflow recipes (safe-rewrite, collaborative-edit, incremental-draft), exposed via MCP resources and a `docforge_orientation` prompt so clients can inject them automatically. TOOLS.md updated with the new resource table and three new tool entries (get_version_content, rename_version, get_activity). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add nullable `harness` column to the `api_keys` table (migration 017) to
tag keys by agent type (claude_code, codex, cursor, generic). The harness
value is stored on create, patchable via PATCH /users/api-keys/{id}, and
forwarded in activity log responses. Also adds GET /users/me/activity — a
cross-document activity feed for the dashboard sidebar — and enriches
GET /documents with `has_api_key_activity` + `last_api_key_name` per doc.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add harness.ts with the Harness enum, per-harness visual metadata (label, logo path, colors) and isHarness() guard. Propagate `harness` through all API types (ApiKey, ApiKeyCreateResponse, DocumentActivity) and add MyActivityEvent for the cross-doc feed. New API calls: apiUpdateApiKeyHarness, apiFetchMyActivity; apiCreateApiKey now accepts an optional harness param. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the flat document table with a two-column layout: a main area with TwinModeTabs (All / Forger / MCP Agent) + DocTableRow cards, and a sidebar with ConnectedAgentsCard (active API keys), RecentActivityCard (cross-doc feed via GET /users/me/activity), and DashboardTipCard. The MCP tab filters for editor documents that have had agent activity, using the new hasApiKeyActivity field from the backend. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
McpPage (/mcp) is a dedicated agent setup hub: tabbed by harness (Claude Code, Codex, Cursor, Generic), shows tailored config snippets, and handles API key generation with harness tagging + revocation. Existing keys can have their harness updated inline. BillingPage (/billing) renders the pricing tiers with a placeholder for future payment integration. Both routes are protected and registered in App.tsx. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… to TopBar EditorActivityRail shows the last 8 activity entries in the editor nav panel, styled with per-harness icons and colors and refreshed on every SSE tick. EditorNavPanel gains an activitySlot prop; EditorLayout wires it up. TopBar gains a dashboardNav prop that renders a centered NavLink row (Dashboard / How it works / DocForge MCP / Billing) when no phase is active. index.css adds df-scroll-thin and marketing-page keyframe animations. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract all inline JSX from LandingPage, HowItWorksPage, and PricingPage into a reusable marketing component library (BrandMark, MarketingNav, TrackPickerCards, PhaseTimelineRow, AgentBadgesStrip, LiveSectionPourMock, McpTeaserCard, ScrollNarratedPhases, McpStepBlocks, ClosingCta). Add supporting SVG assets (claudecode.svg, codex.svg, cursor.svg, robot.svg) for harness badges. Pages are now significantly leaner, delegating all visual logic to their respective components. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DocForge MCP Server
This PR ships the DocForge MCP server and the full product surface needed to support it: API key management, agent activity tracking, a harness classification system, and a redesigned frontend.
What's new
MCP Server (
packages/mcp)A Streamable HTTP MCP server that lets AI agents (Claude Code, Cursor, Codex, etc.) create and write to shared DocForge documents in real-time. The user opens the document URL in their browser and watches the agent fill it in live via SSE — no copy-pasting.
create_document,write_section,snapshot_section,get_section_content,list_versions,get_version_content,select_active_version,rename_version,get_activity,get_user_info,get_document_urldocforge://documents,docforge://document/{id},docforge://document/{id}/versions,docforge://guide/system-prompt(agent orientation brief),docforge://recipes/{slug}(workflow playbooks:safe-rewrite,collaborative-edit,incremental-draft)docforge_orientation— surfaces the system-prompt guide viaprompts/listso MCP clients can inject it automaticallyX-API-Keyheader. stdio removed.API key system (backend)
ApiKeymodel withname,key_hash(SHA-256),harness,created_at,last_used_at,revoked_atPATCH /users/api-keys/{id}— update harness on an existing keyX-API-Keyauthentication path inauth.pyalongside the existing Clerk JWT pathDocumentActivitymodel: records every MCP write, snapshot, and version switch, attributed to the originating API keyHarness field
API keys can be tagged by agent type (
claude_code,codex,cursor,generic). The harness value flows through to activity logs, the editor activity rail, and dashboard cards, where each harness renders with its own icon, color, and label.User activity feed (backend)
GET /users/me/activity— cross-document activity feed for the dashboard sidebar, joined withApiKey.nameandDocument.titleGET /documentsnow returnshas_api_key_activityandlast_api_key_nameper document, used by the dashboard MCP tab filterDashboard redesign (frontend)
HomePageis rebuilt around a two-column layout:TwinModeTabs(All / Forger / MCP Agent), search,DocTableRowcards with harness badgesConnectedAgentsCard(active API keys),RecentActivityCard(live cross-doc feed),DashboardTipCardThe MCP Agent tab filters for editor documents that have had agent activity.
MCP setup page (
/mcp)Dedicated agent configuration hub, tabbed by harness. Each tab shows the exact
~/.claude.json/ IDE config snippet for that agent. Users can generate, tag, and revoke API keys without leaving the page.Billing page (
/billing)Pricing tier cards (Free / Builder / Team). Builder and Team show "Coming soon."
Editor activity rail
EditorActivityRailrenders the last 8 activity entries inline in the editor nav panel, refreshed on every SSE tick. Each entry shows the actor name, action, time ago, and a harness-specific icon badge.Marketing page overhaul
LandingPage,HowItWorksPage, andPricingPageare rewritten using an extractedcomponents/marketing/library:MarketingNav,TrackPickerCards,PhaseTimelineRow,AgentBadgesStrip,LiveSectionPourMock,McpTeaserCard,ScrollNarratedPhases,McpStepBlocks,ClosingCta,BrandMark.TopBar navigation
TopBargains adashboardNavprop that renders a centeredNavLinkrow (Dashboard / How it works / DocForge MCP / Billing) when no document phase is active.CI/CD
GitHub Actions workflow (
deploy-mcp.yml) builds and deploys the MCP server on push tomain.Database migrations
015_add_api_keysapi_keystable016_add_document_activitydocument_activitytable017_add_api_key_harnessharnesscolumn onapi_keysRun
npm run db:migratebefore starting the backend.Test plan
/mcp) — verify it appears in ConnectedAgentsCardX-API-Keyheader — verifycreate_document+write_sectionwork and SSE pushes to the browsernpm run db:migrateon a clean DB — all three migrations apply cleanly