Purpose
function-lookup-mcp is an MCP (Model Context Protocol) server for AI agents to look up code declarations when writing or modifying code. Its goal is to obtain accurate function signatures from any API, reducing AI speculation (hallucination) about unknown or recently updated source files.
Main capabilities
- Provides full-text search of code declarations, allowing retrieval of functions, classes, structs, enums, and other code elements.
- Uses SQLite (with FTS5 support) and universal ctags to build and maintain the index.
- Supports multiple languages that universal ctags can parse, including Python, C, Go, C++, JavaScript, Rust, Java, and more.
- The provided MCP tool functions include:
- search_declarations(name: str, offset: int = 0, limit: int = 10): searches code declarations by name.
- list_indexed_apis(): lists all API files that have been indexed.
- list_api_files(api_name: str, offset: int = 0, limit: int = 100): lists all unique file paths for a specific API.
- list_functions_by_file(file_path: str, offset: int = 0, limit: int = 100): lists all functions found in the specified file.
- generate_ctags(include_directory: str): generates ctags from source files and adds them to the index.
How to use
- Environment dependencies: Universal Ctags 6.2.0; SQLite must support FTS5 (the documentation notes that Python 3.13 includes it built in).
- Extending the index: you can ask the coding agent to index a header file directory. The indexing process follows the project's .gitignore to avoid including unwanted files.
- You can also use universal ctags to manually generate ctags files.
- Or place existing ctags files into the apis/ directory and restart the MCP server to update the index.
Applicable scenarios
- AI coding agents need to look up accurate information about function signatures, class declarations, structs, enums, and other code elements.
- Need to quickly perform declaration-level full-text search in multilingual codebases.
- Want to prevent AI from fabricating function signatures for source files it has not seen or that were recently modified.
Limitations
- Specific installation commands, configuration methods, and complete deployment steps are not yet provided in the available information.
- Information such as pricing, supported platforms, and usage results is not yet provided in the available information.