mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
88e81238dec461d7d069cca7058276198b077984
Ask262
MCP server for exploring the ECMAScript specification and its implementation in engine262.
Features
- Vector search ECMAScript specification sections using semantic queries
- Execute JavaScript in engine262 and capture which spec sections are hit
- Knowledge graph mapping spec sections to implementation functions
- 1-second timeout on code execution for safety
Prerequisites
- Bun: Version 1.0.0 or higher (install)
- Ollama: Installed locally with an embedding model (e.g.,
qwen3-embedding:0.6b)
Installation
# Install globally with bun
bun install -g ask262
# Or run directly without installing
bunx ask262
# Or clone and install
git clone <repository-url>
cd ask262
bun install
Setup
-
Prepare environment:
export OPENAI_API_BASE="your_endpoint_base_url" # Optional export OPENAI_API_KEY="your_api_key" # Optional -
Ensure spec is present (only external requirement):
./spec-built/multipage/- ECMAScript spec HTML files
Note:
storage/(pre-built vectors),engine262/lib/, andgraphology/are included in the package. -
Build knowledge graph (first time only, if using custom spec):
bun run build
MCP Configuration
Add to your MCP client configuration:
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"ask262": {
"command": "bun",
"args": ["run", "/path/to/ask262/src/mcp-server.ts"]
}
}
}
OpenCode (.opencode/mcp.json):
{
"servers": {
"ask262": {
"command": "bun",
"args": ["run", "src/mcp-server.ts"]
}
}
}
Via global install (after bun install -g ask262):
{
"mcpServers": {
"ask262": {
"command": "ask262"
}
}
}
Via bunx (no installation required):
{
"mcpServers": {
"ask262": {
"command": "bunx",
"args": ["ask262"]
}
}
}
Available Tools
| Tool | Description |
|---|---|
ask262_search_spec_sections |
Vector search ECMAScript spec for relevant sections |
ask262_get_section_content |
Retrieve full content from a spec section |
ask262_evaluate_in_engine262 |
Execute JS in engine262 and capture spec section marks |
Testing
# Run MCP server tests
bun run test-mcp-server
# Test evaluate tool with timeout
bun run test-evaluate-timeout
# Test search functionality
bun run test-search-spec-sections
License
ISC
Languages
HTML
49%
JavaScript
32.7%
TypeScript
18.3%