angelscript-mcp
# angelscript-mcp
**[English](README.md)** | **[Español](docs/README.es.md)**
[](https://www.npmjs.com/package/@angelscript-tools/mcp)
[](LICENSE)
An [MCP](https://modelcontextprotocol.io) server that lets an AI agent write [AngelScript](https://www.angelcode.com/angelscript/) that runs inside a host application, such as a game. It gives the agent compile checks that know the host API, symbol search, references, rename and host API lookup, by wrapping the [angel_lsp](https://github.com/angelscript-tools/angelscript-lsp) language server.
Host applications register their own functions and types in C++, so a model cannot know them. The server reads the host's `.as.predefined` stub and tells the agent what exists, instead of letting it invent an API.
For a skill that teaches the workflow, and one-step installs for Claude Code, Codex, Gemini CLI and Antigravity, see [angelscript-agent-kit](https://github.com/angelscript-tools/angelscript-agent-kit).
## Install
You need Node.js 20 or newer. Add the server to any MCP client:
~~~json
{ "mcpServers": { "angelscript": { "command": "npx", "args": ["-y", "@angelscript-tools/mcp"] } } }
~~~
| Client | How |
| --- | --- |
| Claude Code | `claude mcp add angelscript -- npx -y @angelscript-tools/mcp` |
| Codex | `codex mcp add angelscript -- npx -y @angelscript-tools/mcp` |
| Gemini CLI | `gemini mcp add angelscript npx -y @angelscript-tools/mcp` |
| Antigravity | `agy mcp add angelscript npx -y @angelscript-tools/mcp` |
| Claude Desktop | Download `angelscript-mcp-<version>.mcpb` from the [releases](https://github.com/angelscript-tools/angelscript-mcp/releases) and open it |
| Cursor, VS Code, others | Put the JSON above in the client's MCP configuration |
| Container | `docker run -i --rm -v "$PWD:/workspace" ghcr.io/angelscript-tools/angelscript-mcp` |
The server starts in the current folder, which it treats as the project root. Use `--root <dir>` to choose another.
On Windows, if a client cannot start `npx`, use `"command": "cmd"` with `"args": ["/c", "npx", "-y", "@angelscript-tools/mcp"]`.
## Tools
| Tool | Use |
| --- | --- |
| `angelscript_project_info` | Engine version, host stubs, modules, rules file and setup warnings. Call it first. |
| `angelscript_check` | Compile-check files, or the whole workspace, and list errors with line and column. |
| `angelscript_host_api` | Look up a host function, type or enum by part of its name, with documentation and members. |
| `angelscript_find_symbol` | Find where a class, function, method or field is declared; can return its source. |
| `angelscript_find_references` | List every use of a symbol, grouped by file with the source line. |
| `angelscript_file_outline` | The classes, functions and fields of one file, with signatures and line ranges. |
| `angelscript_describe_symbol` | Signature and documentation of a script or host symbol. |
| `angelscript_rename_symbol` | Rename across files. It previews first and writes only with `apply=true`. |
Name a symbol as `Namespace::Class::member`. When a name is ambiguous or overloaded, pass `path/to/file.as:LINE`. Paths are relative to the project root and lines are 1-based.
Every tool returns compact Markdown. Pass `response_format: "json"` for structured data. Long results are paged with `limit` and `offset` and capped at 20 000 characters. Errors say what went wrong and suggest the closest name:
~~~text
> angelscript_check
2 errors, 2 warnings in 2 files.
scripts/main.as:16:15 warning W103 Local variable 'e' is never used.
scripts/main.as:16:19 error E111 Undefined identifier 'Game::SpwnEnemy'.
scripts/main.as:17:25 error W108 Undeclared identifier 'missingText'.
> angelscript_host_api query="Spwn"
The host API has no declaration matching 'Spwn'. Did you mean: `Game::SpawnEnemy`? ... Do not invent the function; ask the user.
~~~
The tools read files from disk, so an agent edits with its own file tools and then calls `angelscript_check`. Only `angelscript_rename_symbol` with `apply=true` writes files.
## Configure the project
The server reads the `angelscript.*` keys of `.vscode/settings.json` in the project root, the same file the [VS Code extension](https://github.com/angelscript-tools/angelscript-lsp) uses:
~~~json
{
"angelscript.predefined.active": "${workspaceFolder}/api/game.as.predefined",
"angelscript.searchDirectories": ["${workspaceFolder}/scripts"],
"angelscript.modules": [{ "name": "Game", "entry": "${workspaceFolder}/scripts/main.as" }],
"angelscript.include.implicitExtension": true
}
~~~
Without a stub the server only checks the language itself, and `angelscript_project_info` warns about it.
| Option | Meaning |
| --- | --- |
| `--root <dir>` | Project root. Default: the current folder. |
| `--lsp-path <file>` | The `angel_lsp` executable. |
| `--predefined <file>` | Host stub to use instead of the one in `settings.json`. |
| `--rules-file <file>` | Engine rules file to use instead of the one in `settings.json`. |
The server finds `angel_lsp` in this order: `--lsp-path`, the `ANGELSCRIPT_LSP_PATH` variable, `PATH`, and a download of the release pinned in `package.json`, checked against `SHA256SUMS` and cached in your user cache folder.
## Develop
~~~sh
npm ci
npm run build
ANGELSCRIPT_LSP_PATH=/path/to/angel_lsp npm test
npx @modelcontextprotocol/inspector node dist/index.js --root /path/to/project
~~~
See [CONTRIBUTING.md](CONTRIBUTING.md) for the rules every tool follows.
## Support
Open an [issue](https://github.com/angelscript-tools/angelscript-mcp/issues).
## Related
| Project | Use |
| --- | --- |
| [angelscript-agent-kit](https://github.com/angelscript-tools/angelscript-agent-kit) | Skill and one-step installs for AI agents |
| [angelscript-lsp](https://github.com/angelscript-tools/angelscript-lsp) | The language server this server wraps, and the VS Code extension |
| [angelscript-cli](https://github.com/angelscript-tools/angelscript-cli) | Run and check loose scripts from the terminal |
## Credits
| Project | License | Use |
| --- | --- | --- |
| [AngelScript](https://github.com/anjo76/angelscript) by Andreas Jönsson | zlib | The language |
| [Model Context Protocol SDK](https://github.com/modelcontextprotocol/typescript-sdk) | MIT | The MCP implementation |
## License
This repository is licensed under the [MIT License](LICENSE).
TDQS
Scored across 8 tools
Each tool has a distinct role within a coherent code-intelligence workflow (discover API → find symbol → describe → find references → rename → check). The only real soft spots are the overlap between angelscript_host_api, angelscript_find_symbol (which also searches host stubs) and angelscript_describe_symbol (which also resolves host API names), but the descriptions give clear guidance on which to prefer in each situation.
Every tool follows the same `angelscript_<verb>_<noun>` snake_case convention (find_symbol, find_references, file_outline, describe_symbol, rename_symbol) with a consistent server prefix. No style mixing or vague one-word names.
Eight tools is well within the sweet spot and each maps to a necessary operation in a scripting-language assistant. Nothing appears redundant or bolted on.
The surface covers workspace discovery, symbol search, cross-file references, structural outline, signature lookup, safe rename with preview/apply, and post-edit compile checks — the core lifecycle of an AgentScript workflow. Minor gaps exist around non-rename code actions (e.g. extract/introduce or generic multi-file edit application), but agents can work around these with file editing plus angelscript_check.