Skip to content

parity(#247): add per-call content parameter to MCP search/find_related and key the session cache on it #85

Description

@amondnet

Summary

Upstream semble #247 (9218491) added a per-call content parameter to the MCP search and find_related tools (code | docs | config | all, default = server's configured content). csp's MCP tools have no content argument; the content filter is fixed at server start.

Upstream

  • mcp.py: content: ContentSelection | None = None on both tools; _resolve_content_selection maps None → server default, "all" → every ContentType.
  • _IndexCache key is now (source_key, tuple[ContentType]); get(source, ref, content); _evict_if_stale / evict take the tuple key.
  • cache.py: find_index_from_cache_folder(path, content) stores non-code scopes at index-<scope> (e.g. index-code-docs); clear index/clear orphans glob */index*.
  • README MCP tool table updated.

csp status

  • crates/csp/src/bin/csp/mcp_server.rs: SearchParams { query, repo, top_k }, FindRelatedParams { file_path, line, repo, top_k }no content.
  • crates/csp/src/mcp.rs::IndexCache holds a single content: Vec<ContentType> and keys entries by source only.
  • Disk cache already keys on content (indexing/cache.rs::resolve_cache_dir hashes sourceId + content + ref), so no on-disk layout change is needed.

Tasks

  • Add content: Option<ContentSelection> to both tool param structs (schemars enum code|docs|config|all), default = server --content.
  • IndexCache key → (source, normalized content); thread content through get / evict / revalidation.
  • Update SERVER_INSTRUCTIONS, README.md + README.ko.md MCP tool table, .please/docs/references/semble.md §4.16.
  • Tests: same repo with different content yields distinct cache entries.

Refs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions