Skip to content

Conversation

@IanMayo
Copy link
Member

@IanMayo IanMayo commented Nov 8, 2025

No description provided.

Create new apps/tools-mcp package with clean FastMCP implementation:

- Pure FastMCP server using the FastMCP framework for MCP protocol
- Dynamic tool discovery and registration from tools directory
- 9 maritime analysis tools copied from tool-vault-packager:
  - Feature management (delete, toggle color)
  - Selection tools (by time, viewport, fit-to)
  - Track analysis (speed filtering)
  - Viewport utilities (grid generation)
  - Text utilities (word count)
- Type-safe with full Pydantic validation
- Automatic schema generation from Pydantic models
- DebriefCommand return types for plot manipulation
- Python wheel build pipeline with setuptools
- Comprehensive documentation (README.md, CLAUDE.md)
- Test script for validation

Architecture:
- server.py: FastMCP server with tool discovery
- tools/: Maritime tool implementations
- Build system: Makefile + pyproject.toml
- Dependencies: FastMCP, Pydantic, shared-types

Resolves #236
Create new ToolsMcpClient service to connect to the pure FastMCP tools server:

- HTTP-based MCP client using JSON-RPC 2.0 protocol
- Tool listing via tools/list method
- Tool execution via tools/call method
- Converts MCP tool responses to DebriefCommand format
- Compatible with legacy ToolRegistry format for outline view
- Health check and connection management
- Comprehensive error handling and logging

This enables VS Code extension to use the new pure FastMCP server
(apps/tools-mcp) instead of the legacy REST-based tool-vault server.

Related to #236
This commit completes the VS Code extension integration with the new
Tools MCP server, providing a modern alternative to the legacy REST-based
Tool Vault server.

Changes:
- Added ToolsMcpClient service (src/services/toolsMcpClient.ts)
  * JSON-RPC 2.0 over HTTP for MCP communication
  * Tool listing via tools/list method
  * Tool execution via tools/call method
  * Converts MCP tool format to ToolVault-compatible structure

- Modified GlobalController (src/core/globalController.ts)
  * Added MCP client integration with initializeToolsMcpClient()
  * Prefer MCP for getToolIndex() with ToolVault fallback
  * Prefer MCP for executeTool() with ToolVault fallback
  * Maintains backwards compatibility with existing code

- Updated extension activation (src/extension.ts)
  * Initialize MCP client if debrief.toolsMcp.serverUrl is configured
  * Connect to MCP server asynchronously on startup
  * Notify GlobalController when MCP client is ready
  * Fall back to ToolVault if MCP connection fails

- Added configuration (package.json)
  * New setting: debrief.toolsMcp.serverUrl
  * Users can specify MCP server URL (e.g., http://localhost:8000)
  * If set, MCP takes precedence over ToolVault

- Added test utilities (test-mcp-protocol.js)
  * Documents MCP JSON-RPC 2.0 protocol format
  * Example requests for tools/list and tools/call

Architecture Benefits:
- Clean separation: MCP client handles protocol, GlobalController handles state
- Fallback mechanism: Legacy ToolVault continues to work if MCP unavailable
- Zero breaking changes: Existing code paths remain functional
- Configuration-driven: Users can opt-in to MCP via settings

Related to: #236 (Pure FastMCP package implementation)
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +173 to +183
# Get speeds and timestamps from the wrapper's convenience properties
speeds = constrained_track.speeds # List[float] - guaranteed to exist and be valid
timestamps = constrained_track.timestamps # List[str] - guaranteed to match speeds length

# Find timestamps where speed meets or exceeds threshold
high_speed_times = []

for i, speed in enumerate(speeds):
if speed >= min_speed:
high_speed_times.append(timestamps[i])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Guard fast speed filter when track timestamps are absent

The fast track speed filter indexes into timestamps[i] for every speed above the threshold, but timestamps is optional in the shared track schema. When a track includes a speeds array but omits timestamps (which is allowed by DebriefTrackFeature), the validator accepts the payload and constrained_track.timestamps becomes an empty list. Any high-speed sample then raises IndexError inside the loop and the tool returns a generic error instead of a command. Either require timestamps during validation or fall back to indices/placeholder times before accessing the array.

Useful? React with 👍 / 👎.

@github-actions
Copy link

github-actions bot commented Nov 8, 2025

🚀 VS Code Extension PR Preview Deployed

Your VS Code extension PR preview has been successfully deployed to Fly.io!

🌐 Preview URL: https://pr-237-futuredebrief.fly.dev

📋 Details:

🔧 What's included:

  • VS Code (code-server) environment
  • Debrief extension pre-installed
  • Sample workspace with test files

💡 How to use:

  1. Click the preview URL above
  2. Open any .plot.json file to test the custom editor
  3. Use Ctrl+Shift+P to access extension commands
  4. Check the Explorer panel for the "Hello World" view

This preview will be automatically updated when you push new commits to this PR.

Remove all ToolVault-related code and make ToolsMcpClient the sole tool provider.
This eliminates the legacy tool-vault-packager dependency and simplifies the
tool integration architecture.

Changes:
- Remove ToolVault server service and configuration files
- Remove ToolVault status bar indicator and commands from extension.ts
- Remove ToolVault fallback logic from globalController.ts
- Rename 'toolVaultReady' event to 'toolsReady' throughout
- Update debriefActivityProvider to use new 'toolsReady' event
- Remove ToolVault-related configuration from package.json
- Remove ToolVault build scripts from package.json
- Remove createToolVaultConfig from serverIndicatorConfigs.ts

The extension now requires debrief.toolsMcp.serverUrl to be configured
for tool functionality. Users will see clear error messages if not configured.
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