Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.internal.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This changelog documents internal development changes, refactors, tooling update

### Added
- Added Cursor harness `[agent=cursor]`, including offline F1 drives for stop/tool activity, resume continuation, and permission synchronization behavior. Also added project-level Cursor CLI permissions mapping from Cyrus tool permissions (including subroutine-time updates), pre-run MCP server enablement (`agent mcp list` + `agent mcp enable <server>`), switched the default Codex runner model to `gpt-5.3-codex`, and aligned edge-worker Vitest module resolution to use local `cyrus-claude-runner` sources during tests. ([CYPACK-804](https://linear.app/ceedar/issue/CYPACK-804), [#858](https://github.com/ceedaragents/cyrus/pull/858))
- Added Fastify MCP transport for `cyrus-tools` on the shared application server endpoint, replacing inline SDK-only wiring with HTTP MCP configuration and per-session context headers. Includes F1 validation covering `initialize` and `tools/list` on `/mcp/cyrus-tools`. ([CYPACK-817](https://linear.app/ceedar/issue/CYPACK-817), [#870](https://github.com/ceedaragents/cyrus/pull/870))

### Fixed
- Updated orchestrator system prompts to explicitly require `state: "To Do"` when creating issues via `mcp__linear__create_issue`, preventing issues from being created in "Triage" status. ([CYPACK-761](https://linear.app/ceedar/issue/CYPACK-761), [#815](https://github.com/ceedaragents/cyrus/pull/815))
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
- **Codex tool activity is now visible in Linear sessions** - Codex runs now emit tool lifecycle activity (including command execution, file edits, web fetch/search, MCP tool calls, and todo updates) so activity streams show execution details instead of only final output. ([#850](https://github.com/ceedaragents/cyrus/pull/850))
- **Codex todo output now renders as proper checklists** - Todo items are now formatted as markdown task lists (`- [ ]` and `- [x]`) for correct checklist rendering in Linear. ([#850](https://github.com/ceedaragents/cyrus/pull/850))
- **Major new feature: Cursor agent harness support** - Cyrus now supports Cursor as a first-class agent option. To use it, set `[agent=cursor]` in the issue description or apply a `cursor` issue label; either selector runs end-to-end with the Cursor runner and posts the final response back to the issue thread. Cursor runs now map Cyrus tool permissions into project-level Cursor CLI permissions, pre-enable configured MCP servers before run, and refresh permissions between subroutines so permission changes take effect without restarting the issue flow. Cursor sandbox is enabled by default for tool execution isolation; set `CYRUS_SANDBOX=disabled` to disable. Before each run, Cyrus validates that the installed `cursor-agent` version matches the tested version; a mismatch posts an error to Linear. Set `CYRUS_CURSOR_AGENT_VERSION` to your installed version to override. Assembled cursor-agent CLI args are now logged to console and session log files for debugging. Codex default runner model is now `gpt-5.3-codex` (configurable via `codexDefaultModel`). ([CYPACK-804](https://linear.app/ceedar/issue/CYPACK-804), [#858](https://github.com/ceedaragents/cyrus/pull/858))
- **Cyrus MCP tools now run on the built-in server endpoint** - Cyrus tools are now served via Fastify MCP on the same configured server port, improving MCP tool availability through a single endpoint. ([CYPACK-817](https://linear.app/ceedar/issue/CYPACK-817), [#870](https://github.com/ceedaragents/cyrus/pull/870))

## [0.2.21] - 2026-02-09

Expand Down
103 changes: 103 additions & 0 deletions apps/f1/test-drives/2026-02-18-cypack-817-fastify-mcp-validation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Test Drive CYPACK-817: Fastify-MCP Cyrus Tools Validation

**Date**: 2026-02-18
**Goal**: Validate that cyrus-tools are served from the existing Fastify server (CYRUS_PORT/CYRUS_SERVER_PORT equivalent) via `fastify-mcp`.
**Test Repo**: `/tmp/f1-test-drive-cypack-817-20260217-185650`
**Server Port**: `3617`

## Verification Results

### Issue-Tracker
- [x] Issue created
- [x] Issue ID returned
- [x] Issue metadata accessible

### EdgeWorker
- [x] Session started
- [x] Worktree created (fallback path used after existing checked-out branch warning)
- [x] Activities tracked
- [x] Agent processed issue

### Renderer
- [x] Activity format correct (`thought`, `action`, `response` visible)
- [x] Pagination works (`--limit`, `--offset`)
- [x] Search works (`--search Bash`)

### MCP Endpoint (CYPACK-817 target)
- [x] `cyrus-tools` endpoint registered on same Fastify server: `/mcp/cyrus-tools`
- [x] MCP `initialize` succeeds with `mcp-session-id` returned
- [x] MCP `tools/list` succeeds and returns cyrus tool set

## Session Log

1. Create fresh F1 repo
```bash
cd apps/f1
./f1 init-test-repo --path /tmp/f1-test-drive-cypack-817-20260217-185650
```
Result: repo created with git init + initial commit.

2. Start F1 server
```bash
cd apps/f1
HOME=/tmp CYRUS_PORT=3617 CYRUS_REPO_PATH=/tmp/f1-test-drive-cypack-817-20260217-185650 node dist/server.js
```
Key output included:
- `✅ Cyrus tools MCP endpoint registered at /mcp/cyrus-tools`
- `RPC endpoint: /cli/rpc`
- `Shared application server listening on http://localhost:3617`

3. Health checks
```bash
CYRUS_PORT=3617 ./f1 ping
CYRUS_PORT=3617 ./f1 status
```
Result: healthy, `status: ready`.

4. Issue + session flow
```bash
CYRUS_PORT=3617 ./f1 create-issue --title "CYPACK-817 MCP fastify validation" --description "Validate cyrus-tools served from fastify-mcp endpoint on CYRUS_SERVER_PORT"
CYRUS_PORT=3617 ./f1 start-session --issue-id issue-1
CYRUS_PORT=3617 ./f1 view-session --session-id session-1 --limit 10 --offset 0
CYRUS_PORT=3617 ./f1 view-session --session-id session-1 --limit 5 --offset 0 --search Bash
```
Result:
- session created (`session-1`)
- activities present with expected types
- pagination/search behavior verified

5. Direct MCP validation on same Fastify server
```bash
curl -X POST http://127.0.0.1:3617/mcp/cyrus-tools \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H 'x-cyrus-mcp-context-id: f1-test-repo:session-1' \
--data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"cypack817-test","version":"1.0.0"}}}'
```
Initialize response included:
- `mcp-session-id: 959cb3f1-b2b2-4597-88f9-e37bf20db049`
- `serverInfo.name: "cyrus-tools"`

Then:
```bash
curl -X POST http://127.0.0.1:3617/mcp/cyrus-tools \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H 'x-cyrus-mcp-context-id: f1-test-repo:session-1' \
-H 'mcp-session-id: 959cb3f1-b2b2-4597-88f9-e37bf20db049' \
--data '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
```
Result: tool list returned (`linear_upload_file`, `linear_agent_session_create`, `linear_agent_give_feedback`, etc.).

6. Cleanup
```bash
CYRUS_PORT=3617 ./f1 stop-session --session-id session-1
# Ctrl+C on server process
```
Result: clean session stop + graceful server shutdown.

## Final Retrospective

- Fastify MCP wiring is working end-to-end on the same server port as RPC/status/version routes.
- `buildMcpConfig` now routes `cyrus-tools` through local HTTP MCP with context headers, and Claude connected successfully (`cyrus-tools MCP session connected` observed).
- One environment-specific issue occurred on an initial run (`EPERM` writing under `/Users/agentops/.claude/debug`); rerunning server with `HOME=/tmp` resolved this in the sandbox and did not affect MCP functionality.
4 changes: 0 additions & 4 deletions packages/claude-runner/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ export {
ClaudeMessageFormatter,
type IMessageFormatter,
} from "./formatter.js";
export {
type CyrusToolsOptions,
createCyrusToolsServer,
} from "./tools/cyrus-tools/index.js";
export {
createImageToolsServer,
type ImageToolsOptions,
Expand Down
4 changes: 3 additions & 1 deletion packages/edge-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
"cyrus-claude-runner": "workspace:*",
"cyrus-cloudflare-tunnel-client": "workspace:*",
"cyrus-codex-runner": "workspace:*",
"cyrus-cursor-runner": "workspace:*",
"cyrus-config-updater": "workspace:*",
"cyrus-core": "workspace:*",
"cyrus-cursor-runner": "workspace:*",
"cyrus-gemini-runner": "workspace:*",
"cyrus-linear-event-transport": "workspace:*",
"cyrus-mcp-tools": "workspace:*",
"cyrus-simple-agent-runner": "workspace:*",
"fastify": "^5.7.3",
"fastify-mcp": "^2.1.0",
"file-type": "^18.7.0",
"ignore": "^7.0.5",
"zod": "4.3.5"
Expand Down
Loading
Loading