---
id: kb-015
title: MCP Duplication Analysis - atoms-mcp-prod vs agentapi/atomsagent
scope:
  type: project
  id: 4sgm
purpose: analysis-mcp-duplication
tags:
  - mcp
  - refactoring
  - analysis
topics:
  - engineering
  - code-quality
version: 1
created: 2025-11-26
updated: 2025-11-26
author: droid-agent
status: final
related_ids:
  - kb-012
  - kb-014
external_refs: []
---

# MCP Duplication Analysis

## Problem Statement

The embedded MCP server in `agentapi/atomsagent` duplicates several tools found in `atoms-mcp-prod`, particularly those related to requirements and document management. Both servers interact with the same Supabase backend, leading to redundant code and potential maintenance issues.

## Overlap Analysis

### 100% Duplicates (Requirements)
- **`agentapi`**: `search_requirements`, `create_requirement`.
- **`atoms-mcp-prod`**: `entity_operation(operation='search', entity_type='requirement')`.
- **Finding**: `atoms-mcp-prod` is more feature-rich, supporting advanced filters, pagination, and RBAC.

### Partial Duplicates (Documents)
- **`agentapi`**: `analyze_document`.
- **`atoms-mcp-prod`**: `entity_operation(operation='read', entity_type='document')` and `data_query(query_type='rag_search')`.
- **Finding**: `agentapi` has built-in Claude integration for analysis, while `atoms-mcp-prod` focuses on data retrieval.

### Unique Tools in agentapi
- `search_codebase` (using ripgrep).
- `execute_in_sandbox` (Vercel Sandbox).
- Sandbox metrics and tracing tools.

---

## Recommendations

### Option 1: Remove Duplicates & Compose (Recommended)
- **Action**: Delete `search_requirements` and `create_requirement` from `agentapi`.
- **Action**: Register `atoms-mcp-prod` as an external server in the `agentapi` registry.
- **Benefit**: Establishes `atoms-mcp-prod` as the single source of truth for entity operations while preserving unique sandbox and codebase tools.

### Option 2: Renaming & Scoping
- Rename the embedded `agentapi` server to `atoms-agent-tools` to avoid namespace collisions during composition.

---

## Conclusion

By removing redundant database-access tools from `agentapi` and composing the more robust `atoms-mcp-prod`, the system achieves better separation of concerns and higher feature parity across different clients.
