Skip to content

feat: add content filter to MCP - #247

Merged
Pringled merged 6 commits into
mainfrom
feat/mcp-content-filter
Aug 12, 2026
Merged

feat: add content filter to MCP#247
Pringled merged 6 commits into
mainfrom
feat/mcp-content-filter

Conversation

@Pringled

@Pringled Pringled commented Aug 11, 2026

Copy link
Copy Markdown
Member

This PR adds a content argument to MCP, just like the CLI, resolving #246. Searches still default to code. When docs, config, or all is explicitly requested, the MCP lazily builds an index containing exactly that content and caches it separately for reuse. This avoids making the default indexing path slower or unexpectedly indexing large non-code files.

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/semble/cache.py 100.00% <100.00%> (ø)
src/semble/cli.py 100.00% <100.00%> (ø)
src/semble/index/index.py 100.00% <100.00%> (ø)
src/semble/installer/agents.py 100.00% <ø> (ø)
src/semble/mcp.py 100.00% <100.00%> (ø)
src/semble/version.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (2): Last reviewed commit: "refactor: build MCP content indexes lazi..." | Re-trigger Greptile

@Pringled
Pringled requested a review from stephantul August 11, 2026 06:21

@stephantul stephantul left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small and speculative comments, but looks good to me otherwise regardless, thanks!

Comment thread src/semble/cache.py Outdated
"""Find an exact content index in the cache for a project path."""
cache_dir = resolve_cache_folder() / cache_key(path)
return cache_dir / "index"
scope = "-".join(content_type.value for content_type in ContentType if content_type in content)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a sort would be safer here. I can imagine us adding things which might change the Enum order. (I think Enums are safely sortable though).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah that's a bit nicer, willdo

Comment thread src/semble/mcp.py

_CACHE_MAX_SIZE = 10 # Max number of cached indexes to keep in memory
_MIN_REVALIDATE_FACTOR = 3 # Don't recheck staleness sooner than this many times the last build's duration
ContentSelection = Literal["code", "docs", "config", "all"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be derived from the Enum? Not sure if it makes sense to do so.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I thought about this but the answer is... not really, because the type would need to be a union of ContentType and the new "all", but we also cannot add "all" to contentype because it's not a contenttype.

@Pringled
Pringled merged commit 9218491 into main Aug 12, 2026
16 checks passed
@Pringled
Pringled deleted the feat/mcp-content-filter branch August 12, 2026 05:30
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.

2 participants