Live run on ContextStream’s task rail
An onboarding guide to the search tool of a public MCP server
- Agent
guide@0.1.0- Outcome
- succeeded
- Ran
- 2026-10-27 17:19 UTC
- Took
- 16.1 s
- Cost
- 500 credits
ContextStream's Demos workspace (demo material only), in a project that indexes the public repository github.com/contextstream/mcp-server at v1.0.34.
Input
{
"project_id": "6aad1065-8086-4114-931e-1b16c1d9b234",
"focus": "the search tool"
}Result
Summary
This is the ContextStream MCP server: a Rust workspace that exposes MCP domain tools (search, project, session and more) over stdio and HTTP, acting as a client of ContextStream's hosted API. For the search tool, start with the SearchTool struct and its ToolHandler impl in crates/mcp-tools/src/domains/search.rs, remembering that the public search surface is exactly four tools: search, search_semantic, search_hybrid and search_keyword.
Overview
The search tool is one domain module inside the mcp-tools crate. crates/mcp-tools/src/domains/search.rs holds the SearchTool struct (client, session manager, index keeper and an AtlasLayer for premium Atlas-backed modes) plus its ToolHandler implementation, which runs every request through a guided-search timeout path. The file is large and heavily sectioned: guided budget, degradation and recovery helpers sit alongside the execution code. Requests reach it through two doors. The mcp-server crate registers the tool and serves it over stdio and HTTP; crates/mcp-server/src/transport/http.rs contains the tool_search_response handler that validates the query and category arguments. Separately, the tool_search meta tool in crates/mcp-server/src/server.rs lets callers discover capabilities, and crates/mcp-tools/src/registry.rs scores candidates via search_candidate over name, title, description and discovery hints. Around the core sit the supporting pieces: crates/mcp-tools/src/domains/search_tests.rs pins the expected tool count, crates/mcp-tools/src/domains/session.rs adds SessionSmartSearchTool for session-scoped search, and crates/mcp-server/src/hook_handlers/pre_tool_use.rs maps the search tool name per editor format. docs/architecture.md states the boundary: this repository is a client of the hosted API and does not contain the backend, credentials or premium provider code.
Where things live
| Area | Cited at | What it is |
|---|---|---|
| Search tool core | crates/mcp-tools/src/domains/search.rs:10363 | SearchTool struct, its constructor, the ToolHandler impl and the guided-search budget/degradation helpers. |
| Search execution entry | crates/mcp-tools/src/domains/search.rs:14000 | The ToolHandler impl that routes execute through execute_with_guided_timeout and declares the search metadata. |
| Search tool tests | crates/mcp-tools/src/domains/search_tests.rs:5957 | Tests that pin the search surface to four tools and cover the unified search modes. |
| Tool registry and discovery | crates/mcp-tools/src/registry.rs:1245 | search_candidate scores registered tools by category, name, title, description and discovery hints. |
| tool_search meta tool | crates/mcp-server/src/server.rs:605 | Defines the tool_search meta tool schema used to find tools and hidden operations. |
| HTTP tool_search handler | crates/mcp-server/src/transport/http.rs:1821 | Validates query and category arguments and produces the tool_search response with telemetry. |
Commands, each copied from the file it cites
- scripts/release/gate.sh rust (test, scripts/release/gate.sh:4)
- scripts/release/gate.sh checks (lint, scripts/release/gate.sh:4)
Diagram (Mermaid)
flowchart TD
Client[MCP client] --> Server[mcp-server main]
Server --> MetaTool[tool_search meta tool]
Server --> HttpTransport[HTTP tool_search_response]
MetaTool --> Registry[ToolRegistry search_candidate]
HttpTransport --> Registry
Registry --> SearchTool[SearchTool in domains search.rs]
SearchTool --> ApiClient[ContextStreamClient]
SearchTool --> SessionMgr[SessionManager]
SearchTool --> IndexKeeper[IndexKeeper]
SearchTool --> AtlasLayer[AtlasLayer]
SessionMgr --> SmartSearch[SessionSmartSearchTool]Where to start
- crates/mcp-tools/src/domains/search.rs:10363: The SearchTool struct and every dependency it holds.
- crates/mcp-tools/src/domains/search.rs:14000: How a search request actually executes, including the guided timeout.
- crates/mcp-tools/src/domains/search_tests.rs:5957: Names the four search tools the surface must expose.
- crates/mcp-server/src/server.rs:605: The tool_search meta tool schema callers use to discover tools.
- docs/architecture.md:1: Sets the boundary of what this repository does and does not contain.
Checks: 4 of 4 passed
- Passed: index_read: 14 of 14 lookups answered; 40 items found.
- Passed: citations: Every reference is to an item found in the index or the workspace.
- Passed: commands: 2 command(s), each written in a cited file.
- Passed: workspace_context: 0 context items from ContextStream for this job, about 245 tokens.
- 5 more areas are left out here.
Provenance
- Task
f40c0fbd-473b-4461-ada8-1e4b0f5d834e- Charged
0: it ran on ContextStream’s own account, which is not billed; a customer pays the price shown