The Nia Codebase MCP server enables integration with Nia's codebase understanding capabilities through function calling in tools like Cursor, Claude Desktop, and other MCP-compatible clients. It allows you to query and analyze your codebase to retrieve relevant context and information.
You can use the Nia Codebase MCP server without installing it by running it with npx:
npx -y [email protected] --api-key=YOUR_NIA_API_KEY --transport=stdio
This is the default transport method when no transport is specified:
npx -y nia-codebase-mcp --api-key=YOUR_NIA_API_KEY
To use SSE transport, specify the --transport=sse
flag and optionally a port (default is 3000):
npx -y nia-codebase-mcp --api-key=YOUR_NIA_API_KEY --transport=sse --port=3000
nia-codebase
command
npx -y [email protected] --api-key=YOUR_NIA_API_KEY
Add to your Claude Desktop configuration:
For macOS:
{
"mcpServers": {
"nia-codebase": {
"command": "npx",
"args": ["-y", "[email protected]", "--api-key=YOUR_NIA_API_KEY"]
}
}
}
Configuration path:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
The MCP server provides a tool called lookup_codebase_context that retrieves relevant code snippets based on your queries.
Use these prompts in your MCP-compatible client:
Using the lookup_codebase_context tool, please analyze my project structure and tell me what the main components are.
Using the lookup_codebase_context tool, search the codebase to understand how the authentication system works and explain its key components.
You can configure the server using these command-line arguments:
--api-key
: Your Nia API key--transport
: Transport method (stdio
or sse
)--port
: Port for SSE transport (default: 3000)--debug
: Enable debug mode for troubleshootingExample with debug mode:
npx -y [email protected] --api-key=YOUR_NIA_API_KEY --debug=true
Alternatively, use environment variables for configuration:
NIA_API_KEY
: Your Nia API keyTRANSPORT
: The transport method (stdio
or sse
)PORT
: The port for SSE transport (default: 3000)TOOL_TIMEOUT_MS
: Custom timeout for tool execution (default: 300000ms)DEBUG
: Enable debug mode (true
or false
)To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "nia-codebase" '{"command":"npx","args":["-y","[email protected]","--api-key=YOUR_NIA_API_KEY"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"nia-codebase": {
"command": "npx",
"args": [
"-y",
"[email protected]",
"--api-key=YOUR_NIA_API_KEY"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"nia-codebase": {
"command": "npx",
"args": [
"-y",
"[email protected]",
"--api-key=YOUR_NIA_API_KEY"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect