# maz1n0-zzz/facebook-mcp architecture

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

- Interactive diagram: https://gitdiagram.com/maz1n0-zzz/facebook-mcp
- Repository: https://github.com/maz1n0-zzz/facebook-mcp

## Overview

This is a small STDIO MCP server for publishing and managing Facebook Page content through Meta Graph API. An MCP client connects over STDIO, discovers the registered tools, and invokes one; the request handler dispatches it, the handler builds an operation-specific Graph API request, and the API helper supplies configured credentials and returns the response. The tools cover Page information, text/link/photo/video publishing, post management, and comments. All runtime behavior is in one source file, so domain components share its path.

Main entry points: [`src/index.ts`](https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts) (Graph API helper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mcp["MCP interface"]
  node_stdio["STDIO transport<br/>[index.ts]"]
  node_server["MCP server<br/>[index.ts]"]
  node_tool_catalog["Tool catalog<br/>[index.ts]"]
  node_dispatcher["Tool dispatcher<br/>[index.ts]"]
end

subgraph group_operations["Page operations"]
  node_page_info["Page information<br/>[index.ts]"]
  node_publishing["Content publishing<br/>[index.ts]"]
  node_post_management["Post management<br/>[index.ts]"]
  node_comments["Comment management<br/>[index.ts]"]
end

subgraph group_integration["Graph API integration"]
  node_config["Page credentials<br/>[index.ts]"]
  node_api_helper["Graph API helper<br/>[index.ts]"]
end

node_client(("MCP client"))
node_facebook["Meta Graph API"]

node_client -->|"connects over"| node_stdio
node_stdio -->|"connects transport"| node_server
node_server -->|"lists tools"| node_tool_catalog
node_server -->|"dispatches calls"| node_dispatcher
node_dispatcher -->|"handles lookup"| node_page_info
node_dispatcher -->|"handles publishing"| node_publishing
node_dispatcher -->|"handles posts"| node_post_management
node_dispatcher -->|"handles comments"| node_comments
node_page_info -->|"requests data"| node_api_helper
node_publishing -->|"submits content"| node_api_helper
node_post_management -->|"manages posts"| node_api_helper
node_comments -->|"manages comments"| node_api_helper
node_api_helper -->|"reads credentials"| node_config
node_api_helper -->|"sends HTTP requests"| node_facebook

click node_stdio "https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts"
click node_server "https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts"
click node_tool_catalog "https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts"
click node_dispatcher "https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts"
click node_page_info "https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts"
click node_publishing "https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts"
click node_post_management "https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts"
click node_comments "https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts"
click node_config "https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts"
click node_api_helper "https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts"

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_stdio,node_server,node_tool_catalog,node_dispatcher,node_client toneBlue
class node_page_info,node_publishing,node_post_management,node_comments toneAmber
class node_config,node_api_helper,node_facebook toneMint
```

## Components

### MCP interface

- [STDIO transport](https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts): `src/index.ts`
- [MCP server](https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts): `src/index.ts`
- [Tool catalog](https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts): `src/index.ts`
- [Tool dispatcher](https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts): `src/index.ts`

### Page operations

- [Page information](https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts): `src/index.ts`
- [Content publishing](https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts): `src/index.ts`
- [Post management](https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts): `src/index.ts`
- [Comment management](https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts): `src/index.ts`

### Graph API integration

- [Page credentials](https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts): `src/index.ts`
- [Graph API helper](https://github.com/maz1n0-zzz/facebook-mcp/blob/main/src/index.ts): `src/index.ts`

### Other components

- **MCP client**
- **Meta Graph API**

## Connections

- MCP client → STDIO transport: connects over (evidence: `src/index.ts`)
- STDIO transport → MCP server: connects transport (evidence: `src/index.ts`)
- MCP server → Tool catalog: lists tools (evidence: `src/index.ts`)
- MCP server → Tool dispatcher: dispatches calls (evidence: `src/index.ts`)
- Tool dispatcher → Page information: handles lookup (evidence: `src/index.ts`)
- Tool dispatcher → Content publishing: handles publishing (evidence: `src/index.ts`)
- Tool dispatcher → Post management: handles posts (evidence: `src/index.ts`)
- Tool dispatcher → Comment management: handles comments (evidence: `src/index.ts`)
- Page information → Graph API helper: requests data (evidence: `src/index.ts`)
- Content publishing → Graph API helper: submits content (evidence: `src/index.ts`)
- Post management → Graph API helper: manages posts (evidence: `src/index.ts`)
- Comment management → Graph API helper: manages comments (evidence: `src/index.ts`)
- Graph API helper → Page credentials: reads credentials (evidence: `src/index.ts`)
- Graph API helper → Meta Graph API: sends HTTP requests (evidence: `src/index.ts`)
