Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the tool registry and discovery system, replacing the old adapter-based architecture with a simpler, more direct approach. The changes consolidate tool registration into a new humcp package with a decorator-based system that auto-discovers tools at startup.
Key Changes
- New architecture: Removed the adapter layer (FastMCPFastAPIAdapter, RouteGenerator) in favor of a direct decorator-based tool registry with unified route generation
- Simplified tool registration: Tools now use
@tool()decorator fromsrc.humcp.decoratorwith automatic name generation from category and function name - Streamlined server creation: Consolidated server initialization into
src.humcp.server.create_app()with automatic tool discovery and both REST and MCP endpoint registration
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/humcp/registry.py |
New tool registry module with ToolRegistration dataclass and global registry |
src/humcp/decorator.py |
New @tool decorator for registering tools with automatic category detection |
src/humcp/routes.py |
New REST route generation with schema extraction from type hints |
src/humcp/server.py |
New unified app creation with automatic tool discovery and MCP integration |
src/humcp/__init__.py |
Empty init file for the new humcp package |
src/main.py |
Simplified entry point using create_app() |
src/tools/local/calculator.py |
Updated tool names from calculator_add to add (and similarly for other calculator tools) |
src/tools/local/local_file_system.py |
Updated import to use src.humcp.decorator |
src/tools/local/shell.py |
Updated import to use src.humcp.decorator |
src/tools/data/csv.py |
Updated import and tool names (e.g., csv_list_csv_files to list_csv_files) |
src/tools/data/pandas.py |
Updated import and tool names with pandas prefix removed |
src/tools/files/pdf_to_markdown.py |
Updated import to use src.humcp.decorator |
src/tools/search/tavily_tool.py |
Updated import and renamed from web_search to tavily_web_search |
src/tools/__init__.py |
Removed old decorator and registry (replaced by src/humcp/) |
src/adapter/ |
Removed entire adapter package (no longer needed) |
src/mcp_register.py |
Removed old MCP registration logic (replaced by server.create_app()) |
tests/humcp/test_models.py |
New tests for model generation from schemas |
tests/humcp/test_decorator.py |
New tests for the @tool decorator and registration |
tests/humcp/__init__.py |
Test package init file |
tests/adapter/ |
Removed old adapter tests (adapter removed) |
README.md |
Updated documentation to reflect new architecture and usage patterns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 26 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…covery' into gl/improve-tool-discovery
ayomaska18
approved these changes
Dec 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
improve tool registry