Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# MCP Code Snippets

This is an local adapter for MCP server that allows Agents to lookup code snippets in your project.
Local MCP implementation allows to auto-fill some arguments for the remote MCP server, and therefore make lookup more accurate.
Local MCP implementation allows to auto-fill some arguments for the remote MCP server, and therefore make lookup more accurate. If no results are found with these arguments, results without arguments are returned.
By default, it uses Qdrant-maintaned remote MCP server with a collection of code snippets, but you can use your own collection by providing a custom MCP proxy configuration.

## Setup
Expand Down
8 changes: 8 additions & 0 deletions mcp_code_snippets/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ async def lookup_snippet(
"qdrant-find",
arguments=arguments,
)

# If empty, try again without filters
if len(result) == 0:
result = await mcp.client.call_tool(
"qdrant-find",
arguments={"query": query},
)

return result


Expand Down