Skip to content

A custom MCP server that combines Serena's semantic code editing capabilities with Git/GitHub operations, packaged as a Docker image for Archestra's K8s-based MCP server runtime.

Notifications You must be signed in to change notification settings

archestra-ai/archestra-coding-agent

Repository files navigation

Archestra Coding Agent

A custom MCP server that combines Serena's semantic code editing capabilities with Git/GitHub operations, packaged as a Docker image for Archestra's K8s-based MCP server runtime.

Features

Serena Tools (Semantic Code Operations)

Project & Configuration

  • activate_project - Activates a project by name or path
  • check_onboarding_performed - Checks if project onboarding was completed
  • onboarding - Performs project onboarding
  • get_current_config - Print current agent configuration
  • prepare_for_new_conversation - Prepares for a new conversation

Symbol Operations

  • find_symbol - Retrieves symbols/code entities by name path pattern
  • find_referencing_symbols - Finds references to a symbol
  • get_symbols_overview - Get high-level overview of code symbols in a file
  • rename_symbol - Renames a symbol throughout the codebase
  • replace_symbol_body - Replaces the body of a symbol
  • insert_after_symbol - Inserts content after a symbol definition
  • insert_before_symbol - Inserts content before a symbol definition

File Operations

  • create_text_file - Write a new file or overwrite an existing file
  • read_file - Reads a file or a chunk of it
  • list_dir - Lists files and directories
  • find_file - Finds files matching a file mask
  • replace_content - Replaces content matching a pattern in a file
  • search_for_pattern - Flexible search for patterns in the codebase

Shell Execution

  • execute_shell_command - Execute a shell command and return output

Memory Management

  • list_memories - List available memories
  • read_memory - Read content of a memory file
  • write_memory - Write information to a memory file
  • edit_memory - Edit content in a memory file
  • delete_memory - Delete a memory file

Thinking Tools

  • think_about_collected_information - Reflect on collected information sufficiency
  • think_about_task_adherence - Check if still on track with the task
  • think_about_whether_you_are_done - Reflect on task completion

Git Tools

  • git_clone - Clone a Git repository to the workspace
  • git_status - Get the git status of a repository
  • git_diff - Show the diff of uncommitted changes
  • git_commit - Stage and commit changes
  • git_push - Push commits to the remote
  • git_checkout_branch - Create a new branch or switch to an existing branch

GitHub Tools

  • github_create_pr - Create a pull request on GitHub
  • github_list_prs - List pull requests for a repository
  • github_get_issue - Get details of a GitHub issue

Configuration

Environment Variables

Variable Required Description
GITHUB_TOKEN Yes GitHub Personal Access Token for API operations
WORKSPACE_DIR No Directory for cloned repos (default: /workspace)

Building

# Build the Docker image
make build

# Build and push to GCP Artifact Registry
make push

Usage in Archestra

  1. Add this MCP server to the internal catalog
  2. Create a profile with this server assigned
  3. Configure GITHUB_TOKEN in the server's environment variables
  4. Start coding!

Local Testing

Build and Run Locally

# Build the Docker image
make build

# Run with a GitHub token
export GITHUB_TOKEN=your-token-here
make run

# Or run an interactive shell for debugging
make shell

Test the MCP Server

  1. Build the image: make build
  2. Start the container:
    docker run -it --rm \
      -e GITHUB_TOKEN=$GITHUB_TOKEN \
      -v $(pwd)/workspace:/workspace \
      -p 9121:9121 \
      europe-west1-docker.pkg.dev/friendly-path-465518-r6/archestra-public/archestra-coding-agent:0.0.1
  3. Connect an MCP client to the server on port 9121

Run Unit Tests

# Install test dependencies
pip install -r requirements.txt pytest

# Run tests
make test

Adding to Archestra Internal Catalog

Use the catalog-entry.json file to add this MCP server to the internal catalog:

  1. Go to the MCP Catalog page in Archestra
  2. Click "Add Internal Server"
  3. Import the configuration from catalog-entry.json
  4. Or use the API:
    curl -X POST http://localhost:9000/api/internal-mcp-catalog \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d @catalog-entry.json

Development

# Install dependencies
pip install -r requirements.txt

# Run tests
pytest tests/ -v

Architecture

┌─────────────────────────────────────────────────────────┐
│                    K8s Pod                              │
│  ┌─────────────────────────────────────────────────┐   │
│  │           archestra-coding-agent                 │   │
│  │  ┌─────────────┐  ┌─────────────────────────┐   │   │
│  │  │   Serena    │  │   Custom Git/GitHub     │   │   │
│  │  │  MCP Server │  │        Tools            │   │   │
│  │  └──────┬──────┘  └───────────┬─────────────┘   │   │
│  │         │                     │                  │   │
│  │         └─────────┬───────────┘                  │   │
│  │                   ▼                              │   │
│  │         ┌─────────────────┐                      │   │
│  │         │  /workspace     │                      │   │
│  │         │  (cloned repo)  │                      │   │
│  │         └─────────────────┘                      │   │
│  └─────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────┘

About

A custom MCP server that combines Serena's semantic code editing capabilities with Git/GitHub operations, packaged as a Docker image for Archestra's K8s-based MCP server runtime.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •