Skip to content

feat: Complete MCP Implementation with 70+ Tools, Agent Skills & Workflow Improvements#1

Merged
rishitank merged 39 commits intomainfrom
feature/workflow-improvements
Jan 5, 2026
Merged

feat: Complete MCP Implementation with 70+ Tools, Agent Skills & Workflow Improvements#1
rishitank merged 39 commits intomainfrom
feature/workflow-improvements

Conversation

@rishitank
Copy link
Copy Markdown
Owner

@rishitank rishitank commented Jan 2, 2026

Summary

This PR implements the complete MCP specification (2025-11-25), adds 70+ tools across multiple categories, introduces an Agent Skills framework for progressive disclosure, and improves development workflows.

MCP Spec Features

Resources Support

  • resources/list - List all indexed files as browsable resources
  • resources/read - Read file content by URI (file:// scheme) with percent-decoding
  • resources/subscribe / resources/unsubscribe - Subscribe to file changes
  • Security: Canonical workspace path validation to prevent path traversal

Progress Notifications

  • notifications/progress support for long-running operations
  • ProgressManager and ProgressReporter for tracking indexing progress
  • Token-based progress tracking

Completions API

  • completion/complete handler for autocomplete
  • File path completions from indexed files and client roots
  • Prompt name completions

Request Cancellation

  • Track active requests with HashSet<RequestId>
  • Separate cancelled_requests set for explicit cancellation tracking
  • Handle notifications/cancelled to cancel in-progress operations

Roots Support

  • Parse client workspace roots from initialize params
  • Store roots for file path resolution and completions

Prompt Templates

  • prompts/list and prompts/get handlers
  • Built-in prompts: code_review, explain_code, write_tests
  • PromptRegistry with proper conditional template handling (mid-line {{#if}} blocks)

Logging Support

  • logging/setLevel handler per MCP spec
  • RFC 5424 severity levels (Debug, Info, Notice, Warning, Error, Critical, Alert, Emergency)

Tool Annotations (MCP Spec 2025-11-25)

  • readOnlyHint, destructiveHint, idempotentHint, openWorldHint
  • Human-readable title for all tools

Tools (70+)

Navigation Tools (3)

Tool Description
find_references Find all usages of a symbol in the codebase
go_to_definition Find where a symbol is defined
diff_files Compare two files with unified diff output

Workspace Tools (7)

Tool Description
workspace_stats Get file counts, lines of code, language breakdown
git_status Get staged, unstaged, untracked files with optional diff
extract_symbols Extract functions, classes, structs from source files
git_log Get commit history with filtering options
git_diff Get diff between commits/branches
dependency_graph Analyze import/dependency relationships
file_history Get git history for a specific file

Specialized Search Tools (7)

Tool Description
search_tests_for Find test files related to a query
search_config_for Find configuration files related to a query
search_callers_for Find callers/usages of a symbol
search_importers_for Find files importing a module/symbol
info_request Simplified codebase retrieval with explanation mode
pattern_search Structural code pattern matching
context_search Context-aware semantic search

Memory Tools (4)

Tool Description
memory_store Store key-value pairs persistently
memory_retrieve Retrieve stored values
memory_list List all stored keys
memory_delete Delete stored values

Skills Tools (2)

Tool Description
search_skills Search available agent skills by keyword
load_skill Load a skill's SKILL.md content

Core Tools (47+)

  • File operations, search, retrieval, code analysis, and more

Agent Skills Framework

Implements Anthropic's Agent Skills architecture for progressive disclosure:

Built-in Skills (7)

Skill Description
planning Task decomposition and project planning
code_review Code quality analysis and review
search_patterns Effective codebase search strategies
debugging Systematic debugging workflows
refactoring Safe code refactoring techniques
documentation Documentation generation and maintenance
testing Test writing and coverage strategies

Skills as MCP Prompts

All skills are exposed via prompts/list and prompts/get for AI client integration.

Multi-Language Symbol Detection

Supports symbol extraction for:

  • Rust: fn, struct, enum, trait, impl
  • Python: def, class, async def
  • TypeScript/JavaScript: function, class, interface, type
  • Go: func, type struct, type interface

Security Fixes

  • Path traversal protection in DependencyGraphTool and complete_file_path
  • Canonical workspace path validation in resource reading
  • Template literal injection prevention in GitHub Actions workflows
  • Regex escaping for user input with regex::escape()
  • Proper error propagation for invalid regex patterns

Workflow Improvements

Release Workflow

  • Triggers automatically after successful CI on main branch
  • Automatic version bumping with patch/minor/major options
  • AI-powered changelog generation
  • Duplicate tag protection

Dependabot

  • Configured for Cargo, GitHub Actions, and Docker
  • Weekly updates with grouped PRs

SDK Sync Workflow

  • Weekly health check for SDK compatibility
  • Creates tracking issues for review
  • Template literal injection prevention

CI Improvements

  • MSRV declared: rust-version = "1.82" in Cargo.toml
  • Clippy with -D warnings flag

Testing

  • 244 unit tests pass
  • Integration tests for MCP protocol
  • ✅ Clippy passes with no warnings
  • ✅ Cargo fmt applied

Test Coverage

  • Resources: MIME types, serialization, security
  • Progress: ProgressReporter, ProgressManager, ProgressToken
  • Navigation: Pattern matching, language detection, diff generation
  • Workspace: Symbol detection for Rust/Python/TypeScript/Go
  • Skills: Loading, searching, frontmatter parsing
  • Memory: Store, retrieve, list, delete operations
  • Prompts: Template substitution, conditional handling

Code Review Fixes

All CodeRabbit review comments addressed:

Issue Commit Fix
Template literal injection b1518b5 Environment variable approach
Template substitution b1518b5 Proper mid-line conditional handling
File URI construction b1518b5 Backslash normalization
Security check b1518b5 Canonical workspace path
Cancellation logic b1518b5 Separate cancelled_requests set
Percent-decoding 07e9094-7e65250 percent_decode_str for URIs
load_skill error handling aa64cef Uses error_result helper
parse_frontmatter bounds aa64cef Safe string slicing
MSRV declaration 1cde7d5 rust-version = "1.82"
Hardcoded repo paths 1cde7d5 {owner}/{repo} placeholders
Regex escaping 1cde7d5 regex::escape() for user input
Regex pre-compilation 1cde7d5 Vec<Regex> before loops
Clippy warning 776dbd8 assert! instead of assert_eq!
include_related flag e38ce36 Reduces max_tokens when false
Regex error propagation a64e759 Returns Result with proper errors

Files Changed

  • 45 files changed
  • 15,915 additions
  • 143 deletions
  • 39 commits

Next Steps After Merge

  1. Set up branch protection for main
  2. Bump version in Cargo.toml to trigger release
  3. Consider adding more skills based on usage patterns

Loading
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.

1 participant