clew-mcp — main (clew/mcp_server/server.py)¶
Overview · 17 steps, 5 lanes
All 17 steps
| # | caller | callee | what it does | requirements | frames | call site |
|---|---|---|---|---|---|---|
| 1 | main | build_server | Construct the MCP server with tier-0 tools registered. | REQ-DDB-MCP-001 | — | clew/mcp_server/server.py:3644 |
| 2 | build_server | lowlevel | The low-level Server behind an SDK server instance. | REQ-DDB-MCP-001 | — | clew/mcp_server/server.py:3502 |
| 3 | build_server | _add_tool | Register one tool, then drop the schema's generated title keys. | — | loop (line 3510) | clew/mcp_server/server.py:3514 |
| 4 | _add_tool | _strip_titles | Remove title keys from a JSON schema, recursively, in place. | — | loop (line 693) | clew/mcp_server/server.py:694 |
| 5 | _strip_titles | _strip_titles | Remove title keys from a JSON schema, recursively, in place. | — | if (line 709), loop (line 717) | clew/mcp_server/server.py:718 |
| 6 | _strip_titles | _strip_titles | Remove title keys from a JSON schema, recursively, in place. | — | elif (line 720), loop (line 720) | clew/mcp_server/server.py:721 |
| 7 | build_server | _refusal_as_tool_error | Wrap a tier-0 tool method so a deliberate refusal reaches the SDK as ToolError. | REQ-DDB-MCP-004 | loop (line 3510) | clew/mcp_server/server.py:3514 |
| 8 | _refusal_as_tool_error | refused | Tag a deliberate refusal so a truncating client still shows the distinction. | REQ-DDB-MCP-004 | catch (line 633) | clew/mcp_server/server.py:634 |
| 9 | build_server | _register_prompts | Register the MCP prompts (2.0.0): served only when a person invokes one. | REQ-DDB-WIKI-034 | — | clew/mcp_server/server.py:3515 |
| 10 | _register_prompts | target_for | Allocate the Target record for a repo path (pure; no I/O). | REQ-DDB-MCP-001 | — | clew/mcp_server/server.py:3412 |
| 11 | target_for | _safe_index_name | Reduce a declared sub-index name to something safe as a directory component. | — | if (line 352) | clew/mcp_server/state.py:352 |
| 12 | target_for | state_home | Per-user state root for built databases and the registry. | REQ-DDB-MCP-001 | — | clew/mcp_server/state.py:353 |
| 13 | build_server | _register_wiki_resources | Register the wiki's resource templates (round 3, P4c-2b). | REQ-DDB-WIKI-034 | — | clew/mcp_server/server.py:3516 |
| 14 | _register_wiki_resources | read_wiki_file | One file of a registered target's built wiki, as text — or a sentence saying why not. | REQ-DDB-WIKI-034 | — | clew/mcp_server/server.py:3446 |
| 15 | read_wiki_file | wiki_site_dir | Where a target's built wiki lives: beside its index. | REQ-DDB-WIKI-034 | — | clew/mcp_server/wikihub.py:943 |
| 16 | _register_wiki_resources | read_wiki_file | One file of a registered target's built wiki, as text — or a sentence saying why not. | REQ-DDB-WIKI-034 | — | clew/mcp_server/server.py:3449 |
| 17 | main | refresh_interval | The background refresh interval in force for this process. | REQ-DDB-MCP-004 | — | clew/mcp_server/server.py:3646 |
Functions¶
15 functions
lowlevelclew/mcp_server/_sdk.pyrefusedclew/mcp_server/freshness.py_add_toolclew/mcp_server/server.py_refusal_as_tool_errorclew/mcp_server/server.py_register_promptsclew/mcp_server/server.py_register_wiki_resourcesclew/mcp_server/server.py_strip_titlesclew/mcp_server/server.pybuild_serverclew/mcp_server/server.pymainclew/mcp_server/server.pyrefresh_intervalclew/mcp_server/server.py_safe_index_nameclew/mcp_server/state.pystate_homeclew/mcp_server/state.pytarget_forclew/mcp_server/state.pyread_wiki_fileclew/mcp_server/wikihub.pywiki_site_dirclew/mcp_server/wikihub.py
This diagram as Mermaid · PlantUML · Graphviz DOT
Quick views¶
15 functions, each with its quick view
- lowlevel
The low-level Server behind an SDK server instance.
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/_sdk.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
Reqs
- refused
Tag a deliberate refusal so a truncating client still shows the distinction.
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/freshness.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
- _add_tool
Register one tool, then drop the schema's generated title keys.
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/server.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _refusal_as_tool_error
Wrap a tier-0 tool method so a deliberate refusal reaches the SDK as ToolError.
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/server.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
- _register_prompts
Register the MCP prompts (2.0.0): served only when a person invokes one.
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/server.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
- _register_wiki_resources
Register the wiki's resource templates (round 3, P4c-2b).
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/server.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
- _strip_titles
Remove title keys from a JSON schema, recursively, in place.
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/server.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- build_server
Construct the MCP server with tier-0 tools registered.
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/server.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
Reqs
- main
Entry point — run the server over stdio.
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/server.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
- refresh_interval
The background refresh interval in force for this process.
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/server.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
Reqs
- _safe_index_name
Reduce a declared sub-index name to something safe as a directory component.
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/state.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- state_home
Per-user state root for built databases and the registry.
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/state.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
Reqs
- target_for
Allocate the Target record for a repo path (pure; no I/O).
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/state.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
Reqs
- read_wiki_file
One file of a registered target's built wiki, as text — or a sentence saying why not.
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/wikihub.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
- wiki_site_dir
Where a target's built wiki lives: beside its index.
Map
Show it on the map, in its block's wedge.
Block
Answer: query engine + MCP server is the block holding
clew/mcp_server/wikihub.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
Reqs