Skip to main content
Glama

DPR Git-Backed MCP Collaboration Server

A standalone Model Context Protocol server that provides a safe, multi-agent, human-in-the-loop collaboration interface over a local Git repository.

Git remains the source of truth for files, commits, branches, diffs, and merge history. This server adds the collaboration control plane above it: identity, authorization, isolated workspaces, Change Requests, reviews, approval policy, conflict workflow, rollback, and provenance.

This is Phase 1: a standalone server, independently usable by Claude Code, VS Code agents, or any other MCP-compatible client. It has no dependency on the DPR multi-agent reasoning project.

Quick start

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

# Optional: configure who this server instance acts as. Defaults to
# human:$USER driving agent:claude-code.
export DPR_PRINCIPAL_ID=charan
export DPR_ACTOR_ID=claude-code

# Optional: where projects/workspaces/the collaboration DB live.
export DPR_REPOSITORY_ROOT=./data/projects
export DPR_WORKSPACE_ROOT=./data/workspaces
export DPR_DATABASE_URL=sqlite:///./data/dpr_mcp.db

dpr-mcp

The server speaks MCP over stdio. Point any MCP-compatible client (Claude Code, an MCP Inspector, a custom client) at the dpr-mcp command.

Related MCP server: GitHub MCP Server

Example flow

create_project(project_id="demo", name="Demo Project")
create_workspace(project_id="demo")            -> workspace_id
create_file(workspace_id, "notes.md", "# Hi")
create_change(workspace_id, rationale="Add notes")   -> change_id
review_change(change_id, decision="APPROVED")  # as a human reviewer
merge_change(change_id)
get_provenance(change_id)

See examples/ for runnable scripts, including a multi-agent conflict scenario (examples/multi_agent_demo.py, examples/conflict_demo.py).

Architecture

See docs/architecture.md for the full picture. In short:

MCP Client
    |
    v
DPR MCP Server  (identity, authz, workspaces, changes, reviews, policy,
    |             conflicts, provenance)
    v
Git Repository  (commits, branches, diffs, merge)

Git is never reinvented: branches, commits, diffs, and merges are all delegated to the real git CLI via a single GitRepository abstraction (src/dpr_mcp/git/repository.py). Collaboration state Git doesn't model (change requests, reviews, approvals, workspaces, policies) lives in a small SQLite database (src/dpr_mcp/persistence/).

Security

File access is sandboxed to the configured project root: path traversal, absolute paths, and symlink escapes are rejected (src/dpr_mcp/files/security.py). Sensitive filenames (.env, .pem, .key, *credentials*) are blocked by default. See docs/security.md and tests/security/ for the full threat model and the tests that enforce it.

Development

pytest                 # unit + integration + security + mcp tests
ruff check src tests
mypy src

Phase 2

Phase 2 (not implemented here) will make the existing DPR multi-agent orchestrator (https://github.com/Skanda-P-R/Multi-Agent-Reasoning) an MCP client of this server, so DPR's internal agents can inspect, create, modify, review, and collaboratively integrate project artifacts through exactly this interface, with Git still holding the version-control ground truth and DPR handling reasoning/orchestration.

Available Tools

32 tools
abandon_changeC

Abandon a Change Request.

Inputs: change_id (required).

apply_conflict_resolutionB

Apply (merge) a previously proposed and reviewed conflict resolution. Subject to the same approval policy as any other merge.

Inputs: conflict_id (required).

approve_changeC

Convenience wrapper: approve a Change Request.

Inputs: change_id (required), comment.

check_mergeabilityB

Check whether a Change Request can merge cleanly into the project's default branch.

Inputs: change_id (required).

create_changeB

Create a Change Request from the commits in a workspace.

Inputs: rationale (required), workspace_id (required).

create_fileB

Create a new file within an active workspace.

Inputs: path (required), content (required), workspace_id (required).

create_projectC

Create a new Git-backed project.

Inputs: name (required), project_id (required).

create_workspaceA

Create an isolated Git worktree workspace for making changes to a project.

Inputs: project_id (required).

delete_fileB

Delete a file within an active workspace.

Inputs: path (required), workspace_id (required).

delete_workspaceB

Delete (remove) a workspace you own.

Inputs: workspace_id (required).

edit_fileC

Edit (overwrite) an existing file within an active workspace.

Inputs: path (required), content (required), workspace_id (required).

get_changeC

Get a Change Request by id.

Inputs: change_id (required).

get_conflictsA

Get structured conflict information for a conflicted Change Request.

Inputs: change_id (required).

get_diffC

Get a structured diff between two revisions in a project.

Inputs: project_id (required), base_revision (required), head_revision (required).

get_historyA

Get commit history for a project, optionally scoped to a path.

Inputs: project_id (required), path, limit, revision. Returns: result

get_project_statusA

Get a summary status (branches, open changes, active workspaces) for a project.

Inputs: project_id (required).

get_provenanceB

Get the complete provenance record for a Change Request.

Inputs: change_id (required).

get_revisionC

Get details for a single commit revision.

Inputs: revision (required), project_id (required).

get_workspaceB

Get details of a workspace by id.

Inputs: workspace_id (required).

list_changesA

List Change Requests for a project, optionally filtered by status.

Inputs: project_id (required), status. Returns: result

list_filesA

List files within a project (optionally under a subpath) at HEAD.

Inputs: project_id (required), subpath. Returns: result

list_projectsA

List all projects known to this server.

Inputs: no named parameters. Returns: result

list_workspacesA

List active workspaces for a project.

Inputs: project_id (required). Returns: result

merge_changeA

Merge an approved, conflict-free Change Request into the project's default branch.

Inputs: change_id (required).

propose_conflict_resolutionA

Propose a resolution to a conflicted Change Request, using commits already made in a separate resolver workspace. This creates a new, independently reviewable Change Request linked to the original conflict.

Inputs: change_id (required), rationale (required), resolver_workspace_id (required).

read_fileC

Read a file's content from within an active workspace.

Inputs: path (required), workspace_id (required).

rebase_changeB

Rebase a Change Request's workspace branch onto the current default branch.

Inputs: change_id (required).

request_changesC

Convenience wrapper: request changes on a Change Request.

Inputs: comment (required), change_id (required).

review_changeC

Record a review (APPROVED, CHANGES_REQUESTED, or COMMENTED) on a Change Request.

Inputs: decision (required), change_id (required), comment.

rollback_changeA

Roll back a previously merged commit on the project's default branch by creating a new forward commit that restores the prior state (never rewrites history).

Inputs: commit_sha (required), project_id (required), rationale.

search_filesA

Search file contents within a project's default branch checkout.

Inputs: query (required), project_id (required).

update_changeA

Update a Change Request's rationale and refresh its head revision.

Inputs: change_id (required), rationale.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 32 tools

    Disambiguation5/5

    Every tool targets a distinct resource-action pair: projects, files, workspaces, changes, and conflicts. Even the convenience wrappers (approve_change, request_changes) are clearly labeled and do not overlap with the core review_change. The boundaries between get_history, get_revision, and get_diff are evident from their descriptions.

    Naming Consistency5/5

    All 32 tool names follow a strict verb_noun pattern in lowercase snake_case (e.g., create_project, list_workspaces, rebase_change). Verbs are consistently imperative and specific, making the toolset predictable and easy to navigate.

    Tool Count3/5

    32 tools is heavy compared to typical server scopes, but the domain (Git-backed project management with workspaces, change lifecycle, and conflict resolution) is broad enough to justify a larger surface. Still, it leans toward the upper limit, and some consolidation could be possible without losing clarity.

    Completeness4/5

    The toolset covers the full lifecycle: project creation, file manipulation, workspace management, change creation/review/merge/rollback, and conflict handling. Minor gaps exist (e.g., no delete_project or rename operations), but the core workflow is complete and agents can accomplish all major tasks without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      A Model Context Protocol server that provides 29 Git operations and advanced workflows, enabling AI assistants and developers to safely manage version control.
      30
      497 npm
      1
      ISC
    • A
      license
      B
      quality
      D
      maintenance
      Enables safe, human-in-the-loop AI document collaboration by letting agents create isolated workspaces, edit tracked files, open reviewable Change Requests, and get human approval before merging, with Git-backed conflict detection and resolution.
      35
      MIT