Skip to content

[codex] Add MCP project management tool#108

Open
IlyaasK wants to merge 2 commits into
mainfrom
codex/projects-mcp-tool
Open

[codex] Add MCP project management tool#108
IlyaasK wants to merge 2 commits into
mainfrom
codex/projects-mcp-tool

Conversation

@IlyaasK
Copy link
Copy Markdown
Contributor

@IlyaasK IlyaasK commented May 29, 2026

Summary

  • Add manage_projects for Kernel project create/list/get/update/delete workflows.
  • Register the projects tool through the new MCP capability module stack from PR 1.5.
  • Keep project handling isolated in src/lib/mcp/tools/projects.ts so route.ts stays HTTP/auth-only.

Agent Experience / Flow

This PR gives agents a first-class way to discover and select the project boundary before doing resource-scoped work. Projects are the isolation primitive that later tools, especially API-key creation, depend on through project_id.

Typical flow:

  1. Agent calls manage_projects list to discover existing projects and avoid creating duplicates.
  2. If the user names a project, agent uses query on list or get by known project_id to resolve the exact target.
  3. If no suitable project exists, agent calls manage_projects create name=<name> and keeps the returned project_id for downstream tool calls.
  4. For project-scoped API keys, agent passes that returned project_id into manage_api_keys create from the next PR.
  5. If project metadata needs to change, agent calls manage_projects update project_id=<id> name=<new> or status=archived.
  6. Agent only calls delete for scratch or explicitly requested projects, because project deletion affects the resource boundary for other workflows.

Agent ergonomics:

  • The action-oriented schema keeps all project lifecycle operations in one tool, but required IDs stay explicit per action.
  • List pagination lets agents scan safely before mutating.
  • Returning the full project object after create/get/update gives agents a stable project_id handoff to later tools.

Validation

  • git diff --check codex/route-tools-breakdown...HEAD
  • KERNEL_CLI_PROD_CLIENT_ID=dummy-prod KERNEL_CLI_STAGING_CLIENT_ID=dummy-staging KERNEL_CLI_DEV_CLIENT_ID=dummy-dev NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_Y2xlcmsuZXhhbXBsZS5jb20k bun run build
  • python3 /Users/ilyaas/.codex/skills/autoreview/scripts/autoreview --mode branch --base codex/route-tools-breakdown
  • localhost MCP CRUD smoke against http://127.0.0.1:3002/mcp with API_BASE_URL=http://127.0.0.1:3001: initialized MCP, verified manage_projects was listed, created a scratch project, got/updated/listed/deleted it, and confirmed post-delete get failed as expected

Note

Medium Risk
Introduces authenticated create/update/delete against org projects; mistakes or overly broad MCP access could change isolation boundaries, though behavior mirrors existing MCP tool patterns.

Overview
Exposes Kernel project lifecycle over MCP via a new manage_projects tool (create, list, get, update, delete), including list pagination and archive-by-status on update.

Wires it in through registerProjectCapabilities in register.ts, with implementation isolated in projects.ts using the authenticated Kernel client like other MCP tools.

Reviewed by Cursor Bugbot for commit 608f5aa. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mcp Ready Ready Preview, Comment Jun 1, 2026 5:53pm

@IlyaasK IlyaasK marked this pull request as ready for review May 29, 2026 18:57
@IlyaasK IlyaasK force-pushed the codex/route-tools-breakdown branch from d15ef46 to 47cc584 Compare May 29, 2026 18:57
@firetiger-agent
Copy link
Copy Markdown

Monitoring Plan: MCP Server Tool Registration Refactored into Modules

What this PR does: Reorganizes internal MCP server code — moves tool, resource, and prompt registration from a single large file into separate module files. No tools added or removed, no user-visible behavior change intended.

Intended effect:

  • Railway HTTP 5xx rate: baseline 0.0017–0.0039% (~4–9 errors/hr); confirmed if rate stays below 0.01% post-deploy
  • MCP transport endpoint availability: baseline — low but steady traffic on MCP paths; confirmed if any MCP calls continue to return expected 200/401 responses (no new 500s)

Risks:

  • Module initialization failure — if any registerX() call throws at startup, all MCP requests return 500; alert if Railway 5xx rate exceeds 0.01% for 30+ minutes post-deploy
  • Profiles resource removalprofiles:// MCP resource was present in the old code but is absent from the new resources.ts; alert if any "resource not found" errors appear for profile URI lookups
  • Import alias failure@/lib/mcp/... path aliases must resolve at Next.js build/runtime; alert if any 500s appear immediately after deploy with module-not-found errors in logs
  • Specific tool regression — any of the 11 newly-modularized tool files could have a subtle handler difference; alert if Railway 5xx rate on MCP paths rises above zero from baseline

Status updates will be posted automatically on this PR as monitoring progresses.

View monitor

rgarcia
rgarcia previously approved these changes Jun 1, 2026
Base automatically changed from codex/route-tools-breakdown to main June 1, 2026 17:45
@IlyaasK IlyaasK dismissed rgarcia’s stale review June 1, 2026 17:45

The base branch was changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants