lookup-syntaxLABSCO SUMMARY
The APL idiom you half-remember, found by describing it.
APLCart is where APL programmers go when they know what they want but not which three glyphs do it. Putting it behind semantic search means the assistant can take "split a vector on a delimiter" and come back with the actual expression.
What it is
An MCP server over APLCart, the searchable collection of APL expressions and their descriptions. Three tools cover the three ways people look an idiom up: by the syntax itself, by words in the description, and by natural-language meaning.
What you get
- An exact-syntax lookup that returns the APLCart entry for an expression
- Search across syntax, descriptions and keywords at once
- The keywords APLCart files a given expression under
- Natural-language queries answered from OpenAI embeddings over the collection
- An optional SQLite backend for faster searches
Requirements
Python 3.11 or higher, and the APLCart data converted locally with aplcart2json.py before the first run. Semantic search additionally needs an OpenAI key in OPENAI_API_KEY and an embeddings pass that writes aplcart.index; the other lookups work without it.
Setup effort
Build from source — git clone https://github.com/xpqz/ac-mcp.git
USE CASES
Finding the idiom for something you can describe but not write
Ask in plain English and the embeddings search returns matching APLCart expressions.
Working out what an expression you inherited does
Look the syntax up exactly as written and read APLCart's description of it.
Widening a search that came back empty
Pull the keywords APLCart files an expression under and search on those instead.
Teaching yourself APL from working examples
Query by meaning, then read the exact syntax and description behind each hit.
4 tools
Listed in project docs. Your client may show a different list.
searchkeywords-forsemantic-searchBEFORE YOU INSTALL
What to know first
Tools you get
4 tools named in the project's documentation.
Requires
- uv on PATH
- Python 3.11 or later
Optional
OPENAI_API_KEY in your environment
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
This one is built from source rather than installed with a single command.
Server setup
git clone https://github.com/xpqz/ac-mcp.git
cd ac-mcp
uv syncFetch and convert the APLCart data — the server has nothing to search until this runs:
uv run python aplcart2json.pyThe Claude Desktop block sets APLCART_USE_DB=1, which reads the SQLite copy of the data; build it with python aplcart2json.py --db from the project's activated virtual environment.
Optional, for semantic-search only: export OPENAI_API_KEY='<YOUR_OPENAI_API_KEY>', then uv run python generate_embeddings.py, which writes aplcart.index.
MCP Clients
Claude Desktop
{
"mcpServers": {
"aplcart": {
"command": "uv",
"args": [
"run",
"--directory",
"<YOUR_PATH_TO_HERE_AC_MCP>",
"python",
"aplcart_mcp_semantic.py"
],
"env": {
"APLCART_USE_DB": "1",
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
}
}
}
}