This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Model Context Protocol (MCP) server that integrates Lever ATS with Claude Desktop, enabling recruiters to manage their recruiting workflows through natural language commands.
-
Environment Setup:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Configuration:
- Copy
.env.exampleto.env - Add your Lever API key:
LEVER_API_KEY=your_api_key_here
- Copy
-
Running the Server:
- The server runs through Claude Desktop configuration (see README.md)
- For development/debugging:
python server.py
-
server.py: Main MCP server implementation
- Implements 16 recruiting tools as MCP endpoints
- Handles rate limiting (8 req/sec, below Lever's 10 req/sec limit)
- Manages tool routing and response formatting
-
client.py (244 lines): Async HTTP client for Lever API
- Handles authentication and request construction
- Implements retry logic and error handling
- Supports pagination for list operations
- Tool Organization: Tools are grouped by domain (candidates, applications, interviews, etc.)
- Error Handling: Comprehensive error messages with actionable guidance
- Rate Limiting: Built-in rate limiter to respect API limits
- Async Operations: All API calls use aiohttp for concurrent operations
- Response Formatting: Consistent formatting for readability in Claude
- API Limits: Lever API allows 10 requests/second; server limits to 8 for safety
- Pagination: List operations return max 100 items per page
- Authentication: Requires valid Lever API key with appropriate permissions
- No Testing Framework: Manual testing through Claude Desktop integration
- No Text Search: The Lever API
/opportunitiesendpoint does NOT support a "query" parameter for text search. To search by name, we fetch all candidates and filter client-side. This is why searches may be slower than expected. - No File Downloads: Files cannot be downloaded directly through Claude Desktop due to authentication and file system limitations. Recruiters should access resumes and documents through the Lever web interface.
- lever_search_by_skills - Use advanced_search with skills parameter
- lever_search_by_location - Use advanced_search with locations parameter
- lever_fuzzy_search - Use advanced_search with multiple criteria
- lever_download_file - Files must be accessed through Lever web interface
- lever_get_resume_url - Files must be accessed through Lever web interface
- lever_get_resume_content - Files must be accessed through Lever web interface
- lever_batch_company_stats - Had pagination errors, use find_by_company instead
- lever_filter_by_companies_efficient - Too complex, use find_by_company or advanced_search
- lever_company_search_simple - Query parameter doesn't work well, use find_by_company
- lever_debug_search - Not needed for recruiters, was for development only
- lever_create_application - POST operations not allowed by Lever API, applications must be created through web interface
When modifying or extending the server:
-
Adding New Tools: Follow the existing pattern in server.py
- Define tool in the appropriate section
- Implement handler method with proper error handling
- Update README.md with usage examples
-
Debugging:
- Check logs from server.py output
- Verify API key permissions in Lever
- Test individual API calls using client.py methods
-
API Integration:
- Lever API v1 documentation: https://hire.lever.co/developer/documentation
- All endpoints require authentication via API key
- Response data should be formatted for readability
- server.py: Main logic for all recruiting tools
- client.py: Only modify for new API endpoints or authentication changes
- README.md: Update when adding new tools or changing setup procedures
- requirements.txt: Keep minimal - only essential dependencies
This project relies on manual testing through Claude Desktop. When making changes:
- Test each modified tool through Claude Desktop
- Verify error handling with invalid inputs
- Check rate limiting behavior under load
- Ensure response formatting remains readable
-
No Stage Modifications: The Lever API does not allow POST operations for stage changes, even with full API access. This is a platform-level restriction. Stage changes must be done manually through the Lever web interface.
-
No Application Creation: The Lever API does not allow POST operations to create new applications. Cross-posting candidates to multiple roles must be done through the Lever web interface.
-
No Text Search: The
/opportunitiesendpoint doesn't support query parameters for text search. Name searches require fetching candidates and filtering locally.
When dealing with 2000+ candidates:
- Use
lever_quick_find_candidatefor name searches (auto-limits to 100) - Apply filters (stage, posting, tags) to reduce results
- Avoid fetching all pages to prevent context window issues