Skip to content

feat: add 18 new MCP tools for session management and observability#31

Merged
jeremyeder merged 2 commits intoambient-code:mainfrom
jeremyeder:feature/issue-27-tools
Feb 16, 2026
Merged

feat: add 18 new MCP tools for session management and observability#31
jeremyeder merged 2 commits intoambient-code:mainfrom
jeremyeder:feature/issue-27-tools

Conversation

@jeremyeder
Copy link
Contributor

Summary

Closes #27

Expands the MCP server from 8 to 26 tools with comprehensive session management and observability capabilities:

  • Session lifecycle: acp_get_session, acp_update_session, acp_restart_session, acp_stop_session, acp_delete_session
  • Bulk operations: acp_bulk_delete, acp_bulk_stop, acp_bulk_restart, acp_bulk_delete_by_label, acp_bulk_stop_by_label, acp_bulk_restart_by_label
  • Label management: acp_label_session, acp_unlabel_session, acp_bulk_label, acp_bulk_unlabel, acp_bulk_label_by_label, acp_bulk_unlabel_by_label
  • Observability: acp_get_session_logs, acp_get_session_transcript, acp_get_session_metrics

Safety features

All bulk destructive operations enforce:

  • confirm=true required (server-layer enforcement)
  • dry_run=true for safe preview
  • 3-item safety limit (MAX_BULK_ITEMS)
  • Label-based bulk ops resolve matching sessions before applying

Changes

File Change
src/mcp_acp/client.py 18 new client methods, time-range parsing, label validation
src/mcp_acp/server.py 18 new tool definitions + dispatch branches
src/mcp_acp/formatters.py format_logs(), format_transcript(), format_metrics(), format_labels()
tests/test_client.py 70+ new tests covering all operations
tests/test_formatters.py Tests for all new formatters
tests/test_server.py Tool listing and dispatch tests
API_REFERENCE.md Complete specs for all 26 tools
README.md Updated tool count, feature list, usage examples
CLAUDE.md Updated architecture docs and tool count

Test plan

  • All 101 tests pass (uv run pytest tests/ -q)
  • Lint clean (ruff format . && ruff check .)
  • Pre-commit hooks pass
  • Manual smoke test against staging cluster

🤖 Generated with Claude Code

…mbient-code#27)

Add comprehensive session management and observability tools to the MCP
server, expanding from 8 to 26 total tools. New capabilities include:

- Session lifecycle: get, update, restart, stop, delete (single + bulk)
- Observability: logs, transcript, metrics retrieval
- Organization: label/unlabel sessions (single + bulk, by name or label)
- Discovery: list sessions filtered by label selectors
- Bulk operations: delete/stop/restart/label/unlabel by name or label
  with dry_run preview, confirm safeguard, and 3-item safety limit

All bulk destructive operations require explicit confirm=true and support
dry_run=true for safe preview. Label-based bulk ops resolve matching
sessions first, then apply the operation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 86.43216% with 54 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/mcp_acp/client.py 81.32% 48 Missing ⚠️
src/mcp_acp/formatters.py 91.54% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

Add 32 new tests covering previously untested paths:

Client layer:
- _run_bulk dry_run path and partial failure handling
- _run_bulk_by_label pipeline (delete/stop/restart by label)
- _run_bulk_by_label with no matching sessions
- bulk_label_sessions (success + dry_run)
- bulk_unlabel_sessions (success + dry_run)

Server dispatch layer:
- get_session, create_session_from_template, clone_session,
  update_session, get_session_logs, get_session_transcript,
  get_session_metrics, label_resource, unlabel_resource,
  list_sessions_by_label
- Confirmation enforcement for all 8 TOOLS_REQUIRING_CONFIRMATION
- Confirmed dispatch for bulk_label, bulk_unlabel, bulk_restart,
  and all 3 by-label bulk operations

Coverage: 72% → 81% overall (client 70→80%, server 63→83%)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeremyeder jeremyeder merged commit 8301653 into ambient-code:main Feb 16, 2026
2 checks passed
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.

Epic: Implement 21 unimplemented MCP tools

1 participant