embark-remote-mcp
v1.0.0
Published
MCP server proxy for Embark code search
Downloads
7
Maintainers
Readme
Embark Remote MCP Server
A Model Context Protocol (MCP) server that provides a proxy interface to Embark's semantic code search capabilities. This server enables LLM applications to search through code repositories using Embark's powerful indexing and similarity search.
Features
- Semantic Code Search: Search for code using natural language queries through Embark's semantic search engine
- MCP Protocol Compliance: Fully compatible with the Model Context Protocol standard
- JWT Authentication: Secure authentication with Embark's API using JWT tokens
- Configurable Repositories: Search across different code repositories
Installation
- Clone the repository:
git clone <repository-url>
cd embark-remote-mcp- Install dependencies:
npm install- Build the project:
npm run buildConfiguration
Environment Variables
GRAZIE_JWT_TOKEN(required): JWT authentication token for Embark APIEMBARK_BASE_URL(optional): Base URL for Embark API (defaults tohttps://api.app.stgn.grazie.aws.intellij.net)REPOSITORY_ID(optional): Default repository ID to search in (can be overridden per search request)
Setting up Authentication
- Obtain a JWT token from your Embark service administrator
- Set the token as an environment variable:
export GRAZIE_JWT_TOKEN="your-jwt-token-here"
export REPOSITORY_ID="ultimate" # optional default repositoryUsage
Running the Server
Using npx (Recommended)
You can run the server directly using npx without cloning the repository:
# Set your authentication token
export GRAZIE_JWT_TOKEN="your-jwt-token-here"
export REPOSITORY_ID="ultimate" # optional
# Run the server
npx embark-remote-mcpRunning from Source
Start the MCP server:
npm startOr for development with auto-reload:
npm run devIntegrating with Claude Desktop
Add the server to your Claude Desktop configuration file:
macOS/Linux: ~/.config/claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Using npx (Recommended)
{
"mcpServers": {
"embark-remote-mcp": {
"command": "npx",
"args": ["embark-remote-mcp"],
"env": {
"GRAZIE_JWT_TOKEN": "your-jwt-token-here",
"REPOSITORY_ID": "ultimate"
}
}
}
}Using Local Installation
{
"mcpServers": {
"embark-remote-mcp": {
"command": "node",
"args": ["/path/to/embark-remote-mcp/dist/index.js"],
"env": {
"GRAZIE_JWT_TOKEN": "your-jwt-token-here",
"REPOSITORY_ID": "ultimate"
}
}
}
}Available Tools
embark_search
Search for code using Embark's semantic search engine.
Parameters:
text(required): The text/code to search forrepository(optional): The repository to search in (defaults toREPOSITORY_IDenvironment variable or "ultimate")
Example:
Search for "authentication middleware" in the codebaseResponse Format:
Found 5 results for "authentication middleware" in repository "ultimate":
1. File=src/middleware/auth.js, offset=120:340, similarity=0.892, type=FUNCTION
2. File=lib/security/middleware.ts, offset=45:180, similarity=0.834, type=CLASS
3. File=routes/auth.js, offset=890:1120, similarity=0.776, type=FUNCTION
...API Reference
Embark API Integration
This server integrates with Embark's REST API:
- Endpoint:
/user/v5/indexing/search - Method: POST
- Authentication: JWT token via
grazie-authenticate-jwtheader - Request Body:
{ "text": "search query", "repository": "repository-name" }
Response Structure
Embark returns search results with the following structure:
interface SearchResponse {
searchResponse: {
res: Array<{
scoredText: {
text: string;
similarity: number;
};
sourcePosition: {
relativePath: string;
startOffset: number;
endOffset: number;
};
indexItemType: string;
}>;
};
}Development
Building
npm run buildDevelopment Mode
npm run devWatch Mode
npm run watchTroubleshooting
Common Issues
- Authentication Error: Ensure your
GRAZIE_JWT_TOKENis valid and not expired - Connection Error: Check that the
EMBARK_BASE_URLis correct and accessible - No Results: Verify the repository name exists and is accessible with your token
Error Messages
GRAZIE_JWT_TOKEN environment variable is required: Set the JWT token environment variableEmbark API error (401): Invalid or expired JWT tokenEmbark API error (404): Repository not found or not accessible
License
MIT
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Support
For issues related to:
- This MCP server: Open an issue in this repository
- Embark API: Contact your Embark service administrator
- Model Context Protocol: See the official MCP documentation
