# harshbhanushali26/mcp-notes-agent architecture

> Architecture diagram of the GitHub repository harshbhanushali26/mcp-notes-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harshbhanushali26/mcp-notes-agent
- Repository: https://github.com/harshbhanushali26/mcp-notes-agent

## Overview

This is a terminal notes agent backed by a sandboxed MCP file server. The user enters a request; the client loads workspace context, resolves optional file attachments or a summary prompt, and sends the request to Groq. When the model requests a tool, the client calls the server, which operates on the notes workspace, then returns the result to the model. The graph preserves the documented tool, resource, and prompt capabilities. Relationships are based on the README and the shown client/server excerpts; the notes directory is workspace data, not an implementation module.

Main entry points: [`client.py`](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/client.py) (Chat loop), [`server.py`](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py) (MCP tools), [`notes`](https://github.com/harshbhanushali26/mcp-notes-agent/tree/main/notes) (Notes files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Terminal client"]
  node_chat["Chat loop<br/>[client.py]"]
  node_attachments["File attachments<br/>[client.py]"]
  node_prompt_trigger["Prompt trigger<br/>[client.py]"]
  node_tool_loop["Tool-calling loop<br/>[client.py]"]
end

subgraph group_mcp["MCP server"]
  node_server_process["Server process<br/>[server.py]"]
  node_tool_api["MCP tools<br/>[server.py]"]
  node_list_files["List files<br/>[server.py]"]
  node_read_file["Read file<br/>[server.py]"]
  node_write_file["Write file<br/>[server.py]"]
  node_edit_file["Edit file<br/>[server.py]"]
  node_search_files["Search files<br/>[server.py]"]
  node_overview["Workspace overview<br/>[server.py]"]
  node_resource_template["File resource<br/>[server.py]"]
  node_summarize_prompt["Summary prompt<br/>[server.py]"]
end

subgraph group_workspace["Notes workspace"]
  node_notes_store[("Notes files")]
end

node_user(("User"))
node_groq["Groq model"]

node_user -->|"enters request"| node_chat
node_chat -->|"launches over stdio"| node_server_process
node_chat -->|"loads overview"| node_overview
node_overview -->|"lists files"| node_notes_store
node_chat -->|"discovers tools"| node_tool_api
node_chat -->|"resolves @ mentions"| node_attachments
node_attachments -->|"reads file resource"| node_resource_template
node_resource_template -->|"reads note"| node_notes_store
node_chat -->|"handles summarize"| node_prompt_trigger
node_prompt_trigger -->|"requests prompt"| node_summarize_prompt
node_chat -->|"sends message"| node_tool_loop
node_tool_loop -->|"requests completion"| node_groq
node_groq -->|"returns tool call"| node_tool_loop
node_tool_loop -->|"calls requested tool"| node_tool_api
node_tool_api -->|"dispatches"| node_list_files
node_tool_api -->|"dispatches"| node_read_file
node_tool_api -->|"dispatches"| node_write_file
node_tool_api -->|"dispatches"| node_edit_file
node_tool_api -->|"dispatches"| node_search_files
node_list_files -->|"lists entries"| node_notes_store
node_read_file -->|"reads text"| node_notes_store
node_write_file -->|"writes text"| node_notes_store
node_edit_file -->|"updates text"| node_notes_store
node_search_files -->|"searches text"| node_notes_store
node_tool_loop -->|"returns tool result"| node_groq

click node_chat "https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/client.py"
click node_attachments "https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/client.py"
click node_prompt_trigger "https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/client.py"
click node_tool_loop "https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/client.py"
click node_server_process "https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py"
click node_tool_api "https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py"
click node_list_files "https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py"
click node_read_file "https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py"
click node_write_file "https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py"
click node_edit_file "https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py"
click node_search_files "https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py"
click node_overview "https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py"
click node_resource_template "https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py"
click node_summarize_prompt "https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py"
click node_notes_store "https://github.com/harshbhanushali26/mcp-notes-agent/tree/main/notes"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_chat,node_attachments,node_prompt_trigger,node_tool_loop,node_user toneBlue
class node_server_process,node_tool_api,node_list_files,node_read_file,node_write_file,node_edit_file,node_search_files,node_overview,node_resource_template,node_summarize_prompt toneAmber
class node_notes_store toneMint
class node_groq toneIndigo
```

## Components

### Terminal client

- [Chat loop](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/client.py): `client.py`
- [File attachments](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/client.py): `client.py`
- [Prompt trigger](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/client.py): `client.py`
- [Tool-calling loop](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/client.py): `client.py`

### MCP server

- [Server process](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py): `server.py`
- [MCP tools](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py): `server.py`
- [List files](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py): `server.py`
- [Read file](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py): `server.py`
- [Write file](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py): `server.py`
- [Edit file](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py): `server.py`
- [Search files](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py): `server.py`
- [Workspace overview](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py): `server.py`
- [File resource](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py): `server.py`
- [Summary prompt](https://github.com/harshbhanushali26/mcp-notes-agent/blob/main/server.py): `server.py`

### Notes workspace

- [Notes files](https://github.com/harshbhanushali26/mcp-notes-agent/tree/main/notes): `notes`

### Other components

- **User**
- **Groq model**

## Connections

- User → Chat loop: enters request (evidence: `README.md`)
- Chat loop → Server process: launches over stdio (evidence: `client.py`)
- Chat loop → Workspace overview: loads overview (evidence: `client.py`)
- Workspace overview → Notes files: lists files (evidence: `server.py`)
- Chat loop → MCP tools: discovers tools (evidence: `client.py`)
- Chat loop → File attachments: resolves @ mentions (evidence: `client.py`)
- File attachments → File resource: reads file resource (evidence: `client.py`)
- File resource → Notes files: reads note (evidence: `server.py`)
- Chat loop → Prompt trigger: handles summarize (evidence: `client.py`)
- Prompt trigger → Summary prompt: requests prompt (evidence: `client.py`)
- Chat loop → Tool-calling loop: sends message (evidence: `client.py`)
- Tool-calling loop → Groq model: requests completion (evidence: `client.py`)
- Groq model → Tool-calling loop: returns tool call (evidence: `README.md`)
- Tool-calling loop → MCP tools: calls requested tool (evidence: `client.py`)
- MCP tools → List files: dispatches (evidence: `server.py`)
- MCP tools → Read file: dispatches (evidence: `server.py`)
- MCP tools → Write file: dispatches (evidence: `server.py`)
- MCP tools → Edit file: dispatches (evidence: `server.py`)
- MCP tools → Search files: dispatches (evidence: `server.py`)
- List files → Notes files: lists entries (evidence: `server.py`)
- Read file → Notes files: reads text (evidence: `server.py`)
- Write file → Notes files: writes text (evidence: `server.py`)
- Edit file → Notes files: updates text (evidence: `server.py`)
- Search files → Notes files: searches text (evidence: `server.py`)
- Tool-calling loop → Groq model: returns tool result (evidence: `client.py`)
