auggie-context-mcp

auggie-context-mcp

Enables AI agents like Claude and Cursor to query codebases using Augment's context engine via the Auggie CLI.

Category
访问服务器

README

There is now an official Augment Code Context Engine MCP:

https://docs.augmentcode.com/context-services/mcp/overview


Auggie Context MCP Server

npm version License: MIT

A Model Context Protocol (MCP) server that exposes Auggie CLI for codebase context retrieval. This allows AI agents like Claude, Cursor, and others to query codebases using Augment's powerful context engine.

Quick Start

This MCP server is designed to be used with MCP clients like Claude Desktop or Cursor. It cannot be used standalone.

Prerequisites

  1. Install Auggie CLI: https://docs.augmentcode.com/cli/overview
  2. Authenticate with Auggie:
    auggie login
    
    This opens a browser for authentication. Once logged in, you're ready to go!

Setup with Claude Desktop

  1. Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
  2. Add this configuration:
{
  "mcpServers": {
    "auggie-context": {
      "command": "npx",
      "args": ["-y", "auggie-context-mcp@latest"]
    }
  }
}
  1. Restart Claude Desktop
  2. You should now see the query_codebase tool available in Claude

Note: If you need to use a specific token instead of your Auggie CLI login, you can add an env section with AUGMENT_SESSION_AUTH. See the Authentication section for details.

Setup with Cursor

  1. Create or edit .cursor/mcp.json in your project or globally
  2. Add the same configuration as above
  3. Restart Cursor

See Installation & Usage section for detailed instructions.

Features

  • 🔍 Codebase Query: Intelligent Q&A over repositories using Augment's context engine
  • 🚀 Simple Setup: Pure TypeScript/Node.js implementation (no Python required)
  • 🔒 Read-Only: Safe context retrieval without file modification capabilities
  • Fast: Direct integration with Auggie CLI
  • 📦 Easy Distribution: Single npm package, works with npx

Requirements

  • Node.js 18+
  • Auggie CLI installed and available on PATH
  • Augment Authentication (see Authentication section below)

Authentication

The server supports two authentication methods:

Option 1: Auggie CLI Login (Recommended)

Simply log in using the Auggie CLI:

auggie login

This opens a browser for authentication. Once logged in, the MCP server will automatically use your Auggie CLI session. No additional configuration needed!

Option 2: Environment Variable (AUGMENT_SESSION_AUTH)

Alternatively, you can provide an explicit access token via the AUGMENT_SESSION_AUTH environment variable.

Get Your Token:

# 1. Ensure Auggie CLI is installed
auggie --version

# 2. Sign in to Augment (opens browser)
auggie login

# 3. Print your access token
auggie token print

This will output something like:

TOKEN={"accessToken":"your-token-here","tenantURL":"https://...","scopes":["read","write"]}

Set the Token in MCP client config:

Add the token to your MCP client configuration:

{
  "mcpServers": {
    "auggie-context": {
      "command": "npx",
      "args": ["-y", "auggie-context-mcp@latest"],
      "env": {
        "AUGMENT_SESSION_AUTH": "{\"accessToken\":\"your-token-here\",\"tenantURL\":\"https://...\",\"scopes\":[\"read\",\"write\"]}"
      }
    }
  }
}

Or set in shell environment:

# Get your token
TOKEN=$(auggie token print | grep '^TOKEN=' | cut -d= -f2-)

# One-time for current session
export AUGMENT_SESSION_AUTH="$TOKEN"

# Or persist in ~/.zshrc or ~/.bashrc
echo "export AUGMENT_SESSION_AUTH='$TOKEN'" >> ~/.zshrc
source ~/.zshrc

Which Method Should I Use?

  • Use Auggie CLI Login if you're the only user on your machine and want the simplest setup
  • Use AUGMENT_SESSION_AUTH if you need to use a specific token or are in a shared/CI environment

⚠️ Security: Never commit tokens to source control. Use environment variables or secure config stores.

Installation & Usage

Note: This server is designed to be used with MCP clients (Claude Desktop, Cursor, etc.). It uses the MCP protocol over stdio and cannot be run standalone.

Cursor Configuration

Add to your Cursor MCP config (.cursor/mcp.json - global or per-project):

Simple setup (uses your Auggie CLI login):

{
  "mcpServers": {
    "auggie-context": {
      "command": "npx",
      "args": ["-y", "auggie-context-mcp@latest"]
    }
  }
}

With explicit token (optional):

{
  "mcpServers": {
    "auggie-context": {
      "command": "npx",
      "args": ["-y", "auggie-context-mcp@latest"],
      "env": {
        "AUGMENT_SESSION_AUTH": "{\"accessToken\":\"your-token-here\",\"tenantURL\":\"https://...\",\"scopes\":[\"read\",\"write\"]}"
      }
    }
  }
}

Claude Desktop (macOS)

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

Simple setup (uses your Auggie CLI login):

{
  "mcpServers": {
    "auggie-context": {
      "command": "npx",
      "args": ["-y", "auggie-context-mcp@latest"]
    }
  }
}

With explicit token (optional):

{
  "mcpServers": {
    "auggie-context": {
      "command": "npx",
      "args": ["-y", "auggie-context-mcp@latest"],
      "env": {
        "AUGMENT_SESSION_AUTH": "{\"accessToken\":\"your-token-here\",\"tenantURL\":\"https://...\",\"scopes\":[\"read\",\"write\"]}"
      }
    }
  }
}

Claude Desktop (Windows)

Edit %APPDATA%\Claude\claude_desktop_config.json:

Simple setup (uses your Auggie CLI login):

{
  "mcpServers": {
    "auggie-context": {
      "command": "npx",
      "args": ["-y", "auggie-context-mcp@latest"]
    }
  }
}

With explicit token (optional):

{
  "mcpServers": {
    "auggie-context": {
      "command": "npx",
      "args": ["-y", "auggie-context-mcp@latest"],
      "env": {
        "AUGMENT_SESSION_AUTH": "{\"accessToken\":\"your-token-here\",\"tenantURL\":\"https://...\",\"scopes\":[\"read\",\"write\"]}"
      }
    }
  }
}

Available Tools

query_codebase

Query a codebase using Augment's context engine.

Parameters:

  • query (required): The question or query about the codebase
  • workspace_root (optional): Absolute path to the workspace/repository root. Defaults to current directory.
  • model (optional): Model ID to use. Example: claude-3-5-sonnet-20241022
  • rules_path (optional): Path to additional rules file
  • timeout_sec (optional): Query timeout in seconds. Default: 240
  • output_format (optional): Output format (text or json). Default: text

Example Usage in Claude/Cursor:

What is the architecture of this codebase?

How does the authentication system work?

Where is the user registration logic implemented?

Show me how the payment processing is handled.

Development

Setup

# Clone the repository
git clone https://github.com/aj47/auggie-mcp.git
cd auggie-mcp

# Install dependencies
npm install

# Build
npm run build

Development Mode

# Watch mode (auto-rebuild on changes)
npm run watch

# Run in development
npm run dev

Testing Locally

# Build the project
npm run build

# Make sure you're logged in to Auggie
auggie login

# Test with MCP Inspector (recommended)
npx @modelcontextprotocol/inspector node dist/index.js

# Or test with a real MCP client (Claude Desktop, Cursor)
# by pointing it to your local build instead of npx

Optional: If you want to test with an explicit token instead of your Auggie CLI login:

export AUGMENT_SESSION_AUTH=$(auggie token print | grep '^TOKEN=' | cut -d= -f2-)
npx @modelcontextprotocol/inspector node dist/index.js

Architecture

┌─────────────────────┐
│   AI Agent          │
│ (Claude, Cursor)    │
└──────────┬──────────┘
           │ MCP Protocol (stdio)
           ▼
┌─────────────────────┐
│ auggie-context-mcp  │
│  (TypeScript/Node)  │
│                     │
│  Tool:              │
│  - query_codebase   │
└──────────┬──────────┘
           │ subprocess
           ▼
┌─────────────────────┐
│   Auggie CLI        │
│  --print --quiet    │
│                     │
│  Augment Context    │
│  Engine             │
└─────────────────────┘

Troubleshooting

Server not showing up in Claude/Cursor

  1. Check config file syntax: Ensure your JSON is valid (no trailing commas, proper quotes)
  2. Verify authentication: Make sure you've run auggie login or set AUGMENT_SESSION_AUTH in the config
  3. Restart the client: Completely quit and restart Claude Desktop or Cursor
  4. Check logs:
    • Claude Desktop (macOS): ~/Library/Logs/Claude/mcp*.log
    • Claude Desktop (Windows): %APPDATA%\Claude\logs\mcp*.log
    • Cursor: Check MCP logs in settings

"Auggie CLI not found"

The server cannot find the Auggie CLI. Ensure it's installed and on your PATH:

auggie --version

If not found, install from: https://docs.augmentcode.com/cli/overview

"Authentication required" or "not logged in"

The Auggie CLI needs authentication. You have two options:

Option 1: Use Auggie CLI login (recommended)

auggie login

Option 2: Set explicit token in MCP config

  1. Run auggie token print to get your token
  2. Copy the entire JSON value (everything after TOKEN=)
  3. Add it to the env section in your MCP config (see examples above)

"Query timed out"

For large codebases, queries may take longer. The default timeout is 240 seconds (4 minutes). If you need more time, you can't currently configure this in the MCP client config, but you can modify the source code and rebuild.

Tool not appearing in Claude/Cursor

  1. Verify the server is configured correctly in your MCP config
  2. Check that the config file is in the correct location
  3. Restart the client application
  4. Look for the query_codebase tool in the available tools list

Security

  • Read-only: This server only queries codebases; it cannot modify files
  • Token safety: Never commit AUGMENT_SESSION_AUTH to version control
  • Workspace isolation: Queries are scoped to the specified workspace

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Links

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选