An MCP server providing semantic search capabilities for APLCart data.
A Model Context Protocol (MCP) server that exposes the APLCart idiom collection with semantic search capabilities. APLCart is a searchable collection of APL expressions with descriptions.
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone the repository
git clone <repository-url>
cd ac-mcp
# Install dependencies
uv sync
First, fetch and convert the APLCart TSV data to JSONL format:
# Using uv
uv run python aplcart2json.py
# Or with activated venv
python aplcart2json.py
# Optional: Generate SQLite database for faster searches
python aplcart2json.py --db
To enable semantic search functionality:
# Set your OpenAI API key
export OPENAI_API_KEY='your-api-key-here'
# Generate embeddings
uv run python generate_embeddings.py
# Or with activated venv
python generate_embeddings.py
This creates:
aplcart.index
- FAISS index file containing embeddingsaplcart_metadata.pkl
- Metadata for semantic search results# Basic usage
uv run python aplcart_mcp_semantic.py
# With SQLite database backend
APLCART_USE_DB=1 uv run python aplcart_mcp_semantic.py
The project includes a .mcp.json.template
file that automatically configures the MCP server. Save that as .mcp.json
, update it with your details, and run /mcp
in Claude Code to see available servers.
You can also manually add the server:
claude mcp add aplcart "uv run python aplcart_mcp_semantic.py"
Add this to your Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"aplcart": {
"command": "uv",
"args": [
"run",
"--directory",
"YOUR/PATH/HERE/ac-mcp",
"python",
"aplcart_mcp_semantic.py"
],
"env": {
"APLCART_USE_DB": "1",
"OPENAI_API_KEY": "${OPENAI_API_KEY}"
}
}
}
}
Then restart Claude Desktop to load the MCP server.
lookup-syntax
- Exact match on APL syntax
Example: lookup-syntax "⍳10"
search
- Substring search across syntax, description, and keywords
Example: search "matrix" limit=10
keywords-for
- Get keywords for a specific syntax
Example: keywords-for "∘.≤⍨∘⍳"
semantic-search
- Natural language search using embeddings
Example: semantic-search "how to split a string on a separator"
You can also use the semantic search functionality directly:
# Interactive mode
uv run python search_embeddings.py
# Single query
uv run python search_embeddings.py "find the largest number"
# JSON output
uv run python search_embeddings.py "reverse an array" --json
# More results
uv run python search_embeddings.py "matrix operations" -k 10
Interactive mode commands:
quit
, exit
, or q
to exit (or Ctrl+D or Ctrl+C)OPENAI_API_KEY
- Required for semantic search functionalityAPLCART_USE_DB
- Set to 1
, true
, or yes
to use SQLite database backendac-mcp/
├── aplcart.jsonl # Converted APLCart data (run aplcart2json.py to generate)
├── aplcart.db # SQLite database (optional)
├── aplcart.index # FAISS embeddings index (run generate_embeddings.py to generate)
├── aplcart_metadata.pkl # Metadata for semantic search (run generate_embeddings.py to generate)
├── aplcart2json.py # Converter script
├── generate_embeddings.py # Embedding generator
├── aplcart_mcp_semantic.py # MCP server with semantic search
├── search_embeddings.py # Standalone search tool
└── pyproject.toml # Project dependencies
APLCart is a searchable collection of APL idioms and expressions maintained at https://aplcart.info/
This project is licensed under the MIT License - see the LICENSE file for details.
Note: The APLCart data itself is subject to its own licensing terms.
Perform lightning-fast local file searches on Windows using the Everything Search Engine.
One API for Search, Crawling, and Sitemaps
A server for Google search and webpage content extraction, built on Cloudflare Workers with OAuth support.
An MCP agent that integrates various search tools using the SearchAPI service. Requires SearchAPI and Google API keys.
MCP server for interacting with the Ordiscan API to query Bitcoin ordinals and inscriptions. Requires an Ordiscan API key.
Provides web search functionality using the DuckDuckGo Search API.
An MCP server for the Context7 project, providing HTTP streaming and search endpoints for library information without local installation.
Exa AI Search API
A Model Context Protocol (MCP) server providing access to Google Search Console.
Interact & query with Meilisearch (Full-text & semantic search API)