Navigating complex Python libraries shouldn't be painful. Peek is a developer tool for API discovery that helps you:
- Understand Python modules quickly through structured inspection
- Explore APIs efficiently with hierarchical navigation
- Extract method signatures with complete type annotations
- Integrate with LLMs through MCP server capabilities
# Install as a development dependency with uv
uv add --dev git+https://github.com/angelsen/peek-tool.git
# Start exploring any Python module
uv run peek requests
# Quick setup with Cursor
uv run peek mcpinitConnect with your favorite AI tools:
- Comprehensive API Discovery - Quickly explore and understand any Python module, class, or method
- Type-Aware Analysis - View detailed parameter and return types from annotations
- JSON Navigation - Parse and traverse complex JSON structures with path-based queries
- LLM Integration - Supercharge AI assistants with Python introspection capabilities
- Developer-Friendly - Clean, concise output tailored to your current context
# Inspect a Python module
uv run peek json
# Inspect a specific class
uv run peek json.JSONEncoder
# Inspect a specific method
uv run peek json.JSONEncoder.encode
# Inspect a JSON file
uv run peek path/to/your/file.json
# Inspect a specific element in a JSON file
uv run peek path/to/your/file.json:path.to.element# Install as a development dependency
uv add --dev git+https://github.com/angelsen/peek-tool.git
# Update to the latest version
uv add --dev git+https://github.com/angelsen/peek-tool.git --upgrade-package peek-tool# Clone the repository
git clone https://github.com/angelsen/peek-tool.git
cd peek-tool
# Install dependencies
uv sync
# Install in development mode
uv add --dev --editable .Peek can supercharge your AI coding workflows by connecting to leading AI tools through MCP (Model Context Protocol).
# Start the MCP server
uv run peek-mcp
# With custom options
uv run peek-mcp --name "My Peek Server" --transport sseAdd to your Claude Desktop config:
- Install Claude Desktop if you haven't already
- Open the Claude menu and select "Settings..."
- Click on "Developer" in the left sidebar, then click "Edit Config"
- Add the Peek server to your configuration:
{
"mcpServers": {
"peek": {
"command": "uv",
"args": ["run", "peek-mcp"],
"env": {}
}
}
}- Save the file and restart Claude Desktop
# Add Peek MCP server to current project (local scope)
claude mcp add peek -- uv run peek-mcp
# Or add it globally (available in all projects)
claude mcp add peek -s user -- uv run peek-mcp
# List configured MCP servers
claude mcp listQuick Setup (Recommended):
# Set up Peek MCP for the current project
uv run peek mcpinitThis creates a .cursor/mcp.json file in your project directory with the proper configuration.
Manual Setup:
- For project-specific configuration, create a
.cursor/mcp.jsonfile in your project directory - For global configuration, create a
~/.cursor/mcp.jsonfile in your home directory - Add the following configuration:
{
"mcpServers": {
"peek": {
"command": "uv",
"args": ["run", "peek-mcp"],
"env": {}
}
}
}- Restart Cursor, and Peek will be available to use from the AI assistant
peek-tool/
├── src/
│ └── peek_tool/
│ ├── __init__.py # Package exports
│ ├── core/ # Core inspection functionality
│ │ ├── base.py # Abstract base classes
│ │ └── python_inspector.py # Python module inspection
│ ├── formatters/ # Output formatters
│ │ ├── base.py # Formatter interface
│ │ └── text.py # Text formatter
│ ├── models/ # Data models
│ │ ├── api_element.py # Models for API elements
│ │ └── inspection_result.py # Inspection results
│ ├── mcp_server/ # MCP server package
│ │ ├── __init__.py # Package marker
│ │ ├── __main__.py # Entry point
│ │ ├── tools.py # MCP tools
│ │ ├── resources.py # MCP resources
│ │ └── prompts.py # MCP prompts
│ └── cli.py # Command-line interface
├── tests/ # Test suite (coming soon)
└── README.md
- Enhanced OpenAPI (Swagger) inspection
- Additional output formats (Markdown)
- Filtering options (e.g.,
--no-privateto hide private methods) - Depth control for adjusting verbosity level
- Interactive navigation mode
- Source code view with syntax highlighting
- Enhanced MCP integration with additional tools and resources
- Web UI for browsing inspection results
MIT License