fabro/lib/crates/fabro-api/tests
Scott Werner c311b6c67f
feat(api): add /api/v1/mcp-servers OpenAPI endpoints (#522)
## What

Adds the HTTP contract for managing server-defined MCP servers. The
handler implementation follows in a later change.

- New `/api/v1/mcp-servers` paths: `list`, `create`, `retrieve`,
`replace`, `delete`, with ETag / `If-Match` optimistic concurrency
mirroring the automations conventions.
- New schemas: `McpServer`, `CreateMcpServerRequest`,
`ReplaceMcpServerRequest`, `McpServerListResponse`.
- **Collapsed a duplicate `McpTransport` schema** into the single
canonical one and gave it a proper `discriminator` plus the
previously-missing optional `protocol` field (`streamable_http` |
`sse`). This also fixes a latent gap in the existing run-config
projection and is non-breaking (`protocol` is `#[serde(default)]`).

## Testing

- `cargo build -p fabro-api` is green — progenitor generates the client
methods and types cleanly from the new spec.

## Notes / follow-ups for the handler change

- Recommended `with_replacement` mapping (reuse, no parallel DTOs):
`McpServer` → `McpServerDefinition`, create/replace →
`McpServerDraft`/`McpServerReplace`, transport → existing
`fabro_types::McpTransport`/`McpHttpProtocol`; list envelopes become
small DTOs.
- Parity caveat: progenitor emits `i64` for the `u64` timeouts and `i32`
for the `u16 port`; harmless under `with_replacement`, but the handler
change must add identity/JSON-parity tests and not skip
`with_replacement` for those types.
- `createMcpServer` returns ETag on 201 (Environments convention) so the
UI gets the fresh revision.
- The "warn vs hard-reject credential-looking literal values" question
is recorded in the request-schema descriptions and intentionally not
enforced.
- Part of a short series adding server-managed MCP servers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 15:50:13 -04:00
..
agent_session_activated_props_round_trip.rs Expose PermissionLevel on StageProjection and add sortable run columns (#373) 2026-05-23 19:41:01 -04:00
automation_round_trip.rs Remove top-level automation enabled master gate (#456) 2026-05-29 22:18:14 -04:00
billed_token_counts_round_trip.rs refactor(api): tighten shared type schemas 2026-04-30 06:20:05 -04:00
command_termination_round_trip.rs feat(command): distinguish cancelled commands from timeouts 2026-04-30 22:45:37 -04:00
completion_message_round_trip.rs feat: chat-driven workflow builder at /playground (#450) 2026-06-09 11:24:56 -04:00
cost_source_round_trip.rs feat(llm): catalog-estimated completion cost on Response (#494) 2026-06-11 16:55:47 -04:00
diff_stats_round_trip.rs refactor: unify duplicate API types via with_replacement 2026-04-28 12:29:37 -07:00
diff_summary_round_trip.rs feat(runs): surface diff summary counts 2026-05-07 17:34:32 -07:00
environment_round_trip.rs feat(workflow): support overriding cwd for local sandbox provider (#467) 2026-06-14 12:32:32 -04:00
event_envelope_round_trip.rs refactor(api): reuse canonical run events 2026-04-29 20:36:59 -04:00
git_context_round_trip.rs refactor: unify duplicate API types via with_replacement 2026-04-28 12:29:37 -07:00
interview_option_round_trip.rs Migrate sandbox config to named environments; add InterviewOption metad… (#372) 2026-05-23 15:47:33 -04:00
interview_question_record_round_trip.rs Migrate sandbox config to named environments; add InterviewOption metad… (#372) 2026-05-23 15:47:33 -04:00
mcp_transport_round_trip.rs feat(api): add /api/v1/mcp-servers OpenAPI endpoints (#522) 2026-06-25 15:50:13 -04:00
model_costs_round_trip.rs refactor(api): tighten shared type schemas 2026-04-30 06:20:05 -04:00
model_features_round_trip.rs feat(llm): add Claude Fable 5 support (#482) 2026-06-10 14:01:56 -04:00
model_limits_round_trip.rs refactor(api): tighten shared type schemas 2026-04-30 06:20:05 -04:00
model_round_trip.rs feat(llm): add Claude Fable 5 support (#482) 2026-06-10 14:01:56 -04:00
model_test_mode_round_trip.rs refactor(api): tighten shared type schemas 2026-04-30 06:20:05 -04:00
pair_round_trip.rs Stage-based pairing API and fabro_run_pair MCP tool (#344) 2026-05-21 21:57:55 -04:00
pending_interview_record_round_trip.rs Migrate sandbox config to named environments; add InterviewOption metad… (#372) 2026-05-23 15:47:33 -04:00
pre_run_push_outcome_round_trip.rs refactor: unify duplicate API types via with_replacement 2026-04-28 12:29:37 -07:00
principal_round_trip.rs feat(web): add server-managed Environments CRUD settings UI (#462) 2026-06-13 08:44:38 -04:00
provider_id_round_trip.rs feat(llm): add Claude Fable 5 support (#482) 2026-06-10 14:01:56 -04:00
provider_round_trip.rs Fix verification fixture drift 2026-05-24 12:14:59 -04:00
pull_request_round_trip.rs feat(pr): support GitHub pull request associations (#270) 2026-05-16 12:47:27 -04:00
question_type_round_trip.rs refactor(api): unify leaf API types 2026-04-29 20:21:23 -04:00
run_billing_stage_round_trip.rs feat: Replace duration/elapsed fields with wall_time_ms and StageTiming (#343) 2026-05-21 21:06:40 -04:00
run_event_round_trip.rs feat(web): add server-managed Environments CRUD settings UI (#462) 2026-06-13 08:44:38 -04:00
run_failure_round_trip.rs feat: Replace duration/elapsed fields with wall_time_ms and StageTiming (#343) 2026-05-21 21:06:40 -04:00
run_integrations_round_trip.rs Move GitHub token permissions to [run.integrations.github.permissions] (#215) 2026-05-05 15:33:31 -04:00
run_projection_round_trip.rs feat(web): add server-managed Environments CRUD settings UI (#462) 2026-06-13 08:44:38 -04:00
run_sandbox_round_trip.rs Model run sandbox lifecycle explicitly (#431) 2026-05-27 12:48:56 -04:00
run_summary_round_trip.rs feat(web): add server-managed Environments CRUD settings UI (#462) 2026-06-13 08:44:38 -04:00
sandbox_details_round_trip.rs Model run sandbox lifecycle explicitly (#431) 2026-05-27 12:48:56 -04:00
sandbox_inventory_round_trip.rs Add provider-backed sandbox inventory API and rename SandboxProvider to… (#409) 2026-05-25 22:41:57 -04:00
sandbox_services_round_trip.rs fix(server): improve sandbox service discovery 2026-05-10 12:40:38 -04:00
secret_metadata_round_trip.rs refactor(auth): split credential sources and vault schemas (#306) 2026-05-18 11:07:42 -04:00
secret_type_round_trip.rs refactor(auth): split credential sources and vault schemas (#306) 2026-05-18 11:07:42 -04:00
server_settings_round_trip.rs refactor: Remove inbound IP allowlisting (#443) 2026-05-27 22:29:08 -04:00
session_contract_round_trip.rs feat(api): add ask fabro session endpoints (#342) 2026-05-21 21:26:15 -04:00
stage_completion_round_trip.rs refactor(run-projection): use stage vocabulary 2026-05-01 19:56:22 -04:00
stage_handler_round_trip.rs feat(api): expose stage handlers on run stages 2026-05-08 13:36:02 -07:00
stage_model_usage_round_trip.rs Surface reasoning_effort + speed in stage badge end-to-end (#363) 2026-05-23 13:14:55 -04:00
stage_outcome_round_trip.rs refactor(api): tighten shared type schemas 2026-04-30 06:20:05 -04:00
stage_projection_round_trip.rs feat: expose effective agent tool list via StageProjection.agent_tools (#388) 2026-05-24 16:41:55 -04:00
stage_state_round_trip.rs refactor(api): tighten shared type schemas 2026-04-30 06:20:05 -04:00
status_round_trip.rs Replace queued with pending/runnable and add approval flow (web + API s… (#371) 2026-05-23 15:34:33 -04:00
submit_answer_request_round_trip.rs fix(api): type interview answer submissions 2026-05-08 09:18:35 -07:00
system_integrations_round_trip.rs feat(system): report runtime integration status (#416) 2026-05-26 19:27:32 -04:00
variable_round_trip.rs feat(server): add variables API (#430) 2026-05-27 11:46:36 -04:00
workflow_settings_round_trip.rs feat: add server-owned environment store (Task 1 & 2 foundation) (#446) 2026-05-28 17:10:59 -04:00