Skip to content

Feat/list repositories filtering#1

Open
dennisonbertram wants to merge 2 commits intoericzakariasson:mainfrom
dennisonbertram:feat/list-repositories-filtering
Open

Feat/list repositories filtering#1
dennisonbertram wants to merge 2 commits intoericzakariasson:mainfrom
dennisonbertram:feat/list-repositories-filtering

Conversation

@dennisonbertram
Copy link

Add client-side filtering for the repositories which currently send too much data.

dennisonbertram and others added 2 commits October 13, 2025 15:00
- Removed bun-types dependency that was causing build errors
- Allows project to compile with standard Node.js

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Problem:
- Cursor API /v0/repositories endpoint returns 28,000+ tokens (exceeds MCP 25K limit)
- No server-side pagination support in Cursor API
- Strict rate limits (1/min, 30/hour) make repeated calls impractical

Solution:
- Implemented 5-minute TTL cache for repository data
- Added client-side filtering by search term and owner
- Added pagination support with limit/offset parameters
- Enhanced tool description with usage examples

Changes:
- src/api-client.ts: Added RepositoryCache class with TTL caching
- src/schemas.ts: Added ListRepositoriesSchema with filter parameters
- src/server.ts: Updated list_repositories tool with filtering logic

Benefits:
- Responses now under 5,000 tokens (well within MCP limits)
- Fast responses via caching (avoids rate limit issues)
- Flexible filtering for users
- Backward compatible (optional parameters)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ericzakariasson
Copy link
Owner

Nice, thank you! Are you able to make a more generic implementation of the cache?

@dennisonbertram
Copy link
Author

Sure, in what way would you want it to be generic?

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