COCOA (short for Code Context Agent, pronounced koh·koh) is a program analysis agent accompanied by a suite of static analysis tools that provides analysis capabilities to LLMs through the Model Context Protocol (MCP).
It leverages the CLDK library to analyze Java projects and expose analysis tools via MCP to act as an agentic AI assistant as well as a toolbox other clients to use.
- 🔍 Static code analysis built on top of CLDK for Java projects
- 🔌 MCP server implementation with a number of static analysis tools for easy integration
- 🛠️ Easy command-line interface and invocation
COCOA uses uv
as the package manager. To install uv
, run:
curl -LsSf https://astral.sh/uv/install.sh | sh
or
wget -qO- https://astral.sh/uv/install.sh | sh
or (for windows users)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
To run the COCOA server, use the following command:
uv run cocoa serve --project-path <path_to_your_java_project>
Replace <path_to_your_java_project>
with the path to the Java project you want to analyze.
You may also use uvx
to run the server directly from this Git repository:
uvx --from git+https://github.com/codellm-devkit/coco-toolbox coco serve --project-path <path_to_your_java_project>
To contribute to COCOA, you can clone the repository and install the development dependencies:
git clone https://github.com/codellm-devkit/coco-toolbox.git
cd coco-toolbox
uv sync --all-groups
Start by looking at the test cases in the tests
directory to understand how to use the tools and the MCP server. You can run the tests using:
uv run pytest --disable-warnings --pspec
Each test case is writen to emulate a MCP client calling the server tool. For example, the test_are_we_ready_tool
tests to check if the server is ready to accept requests by calling the are_we_ready
tool.