Documentation
¶
Overview ¶
Package registration finds where MCP tools, prompts and resources are registered, across direct SDK calls, decorators/annotations/attributes, a wrapper function that forwards into the SDK, and registration inside a loop - working entirely off the graph the parser already built, so it never re-reads source. A registration that cannot be fully resolved is retained with unresolved flags so coverage records uncertainty instead of dropping it.
requesthandler.go recognizes the low-level SDK's request-based registration form, used by the reference MCP servers: a ListToolsRequestSchema (or Python's @app.list_tools()) handler returns the capabilities themselves - an array literal, or an object literal with a "tools"/"prompts"/"resources" array field - and a separate CallToolRequestSchema (@app.call_tool()) handler dispatches every call by name
Index ¶
Constants ¶
const ( // SkipLibraryModule: the receiver is a third-party Python module bound by a plain // `import boto3`, so `boto3.resource("s3")` calls that module's own function SkipLibraryModule = "receiver is an imported third-party module, not a server object" // SkipNoHandler: every argument is a string literal, so the call supplies no handler and no // content - `api.root.add_resource("v1")` in an infrastructure library SkipNoHandler = "only string literal arguments: no handler or content to register" )
Reasons a call shaped like a registration is set aside. Both are facts about the call itself, not guesses from names; each skipped call is kept in graph.SkippedRegistrations for review.
Variables ¶
This section is empty.
Functions ¶
func Discover ¶
Discover finds every tool, prompt and resource registration reachable from the graph's calls, decorators and annotations, and appends them to g.Capabilities
func FileImportsMCPSDK ¶
FileImportsMCPSDK reports whether f imports a module this build recognizes as an MCP SDK
func TreeImportsMCPSDK ¶
TreeImportsMCPSDK reports whether any file in the graph imports a recognized MCP SDK, which is what qualifies a bare `.tool(` call anywhere in it as a registration. The check is tree-wide because helper modules commonly receive a server object without importing its SDK.
Types ¶
This section is empty.