Skip to content

fix(server): harden dynamic tool discovery#26

Merged
mberlofa merged 2 commits into
mainfrom
fix/tool-discovery-hardening
Apr 23, 2026
Merged

fix(server): harden dynamic tool discovery#26
mberlofa merged 2 commits into
mainfrom
fix/tool-discovery-hardening

Conversation

@mberlofa

Copy link
Copy Markdown
Contributor

Summary

  • stop helper modules like *_helpers.py from being auto-registered as MCP tools
  • skip imported functions and unsupported *args/**kwargs signatures instead of crashing server startup
  • document explicit exports with TOOLS and opt-out with __mcp_auto_register__ = False
  • add regression tests for helper modules, imported callables, manifest-based exports, and invalid signatures

Validation

  • python -m pytest tests/test_server_builder.py -q
  • local build_server(...) against c:/devops/berlofa/github/mberlofa/mcp/helmforge succeeded with tool_count=20, resource_count=9, prompt_count=8, knowledge_count=36

@mberlofa mberlofa merged commit 7013ba7 into main Apr 23, 2026
4 checks passed
@mberlofa mberlofa deleted the fix/tool-discovery-hardening branch April 23, 2026 21:10
mberlofa added a commit that referenced this pull request Apr 26, 2026
Follow-up to #26.

## Summary
- consolidates remote MCP hardening in the FastMCP runtime
- adds auth/scope enforcement, safer source loading, protected admin
endpoints, log/error redaction, and Dockerfile checks
- adds .gitattributes and removes fixed demo credentials from examples

## Validation
- python -m pytest: 143 passed
- git diff --check: OK
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