|
1 | | -# @fluently/mcp-server |
| 1 | +# fluently-mcp-server |
2 | 2 |
|
3 | | -MCP (Model Context Protocol) server for the Fluently AI Fluency 4D Framework. Exposes tools for scoring human-AI collaboration quality across the four dimensions: Delegation, Description, Discernment, and Diligence. |
| 3 | +MCP server for the Fluently 4D Framework. Exposes knowledge retrieval and contribution tools so AI agents can find, reason over, and extend Fluently 4D cycles. |
4 | 4 |
|
5 | | -## Installation |
6 | | - |
7 | | -Install as a workspace dependency: |
8 | | - |
9 | | -```bash |
10 | | -npm install |
11 | | -``` |
12 | | - |
13 | | -## Building |
14 | | - |
15 | | -```bash |
16 | | -npm run build |
17 | | -# or in watch mode |
18 | | -npm run dev |
19 | | -``` |
20 | | - |
21 | | -## Running the Server |
22 | | - |
23 | | -### Stdio Transport (Local Use) |
24 | | - |
25 | | -The server runs on stdio by default, suitable for local IDE/editor integration: |
| 5 | +## Install |
26 | 6 |
|
27 | 7 | ```bash |
28 | | -npm start |
29 | | -# or directly |
30 | | -node dist/bin.js |
| 8 | +npm install -g fluently-mcp-server |
| 9 | +4d-mcp-server |
31 | 10 | ``` |
32 | 11 |
|
33 | | -The server will write logs to stderr and protocol messages to stdout. |
| 12 | +## Wire to Claude Desktop |
34 | 13 |
|
35 | | -### HTTP Transport (Optional Deployment) |
| 14 | +`~/Library/Application Support/Claude/claude_desktop_config.json` (Mac) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows): |
36 | 15 |
|
37 | | -To run the server over HTTP (for remote use, though not yet enabled by default), you would modify `src/index.ts` to use `HTTPServerTransport` instead: |
38 | | - |
39 | | -```typescript |
40 | | -import { HTTPServerTransport } from "@modelcontextprotocol/sdk/server/http.js"; |
41 | | - |
42 | | -const transport = new HTTPServerTransport({ |
43 | | - host: "localhost", |
44 | | - port: 3000, |
45 | | -}); |
| 16 | +```json |
| 17 | +{ |
| 18 | + "mcpServers": { |
| 19 | + "fluently": { "command": "4d-mcp-server" } |
| 20 | + } |
| 21 | +} |
46 | 22 | ``` |
47 | 23 |
|
48 | | -Then rebuild and run. |
| 24 | +## Wire to Claude Code |
49 | 25 |
|
50 | | -## Configuration |
51 | | - |
52 | | -### .mcp.json |
53 | | - |
54 | | -The root `.mcp.json` file enables this server in compatible MCP clients: |
| 26 | +In your `settings.json`: |
55 | 27 |
|
56 | 28 | ```json |
57 | 29 | { |
58 | 30 | "mcpServers": { |
59 | | - "fluently": { |
60 | | - "command": "node", |
61 | | - "args": ["./packages/mcp-server/dist/bin.js"] |
62 | | - } |
| 31 | + "fluently": { "command": "4d-mcp-server" } |
63 | 32 | } |
64 | 33 | } |
65 | 34 | ``` |
66 | 35 |
|
67 | 36 | ## Tools |
68 | 37 |
|
69 | | -### 1. compare_problem_space |
70 | | - |
71 | | -Finds the top 3 similar past 4D plays from the knowledge base. |
| 38 | +| Tool | Purpose | |
| 39 | +|---|---| |
| 40 | +| `list_domains` | List available domains and cycle counts | |
| 41 | +| `find_relevant_cycles` | Retrieve ranked candidate cycles for a task (no scores — agent reasons) | |
| 42 | +| `get_cycle_detail` | Full 4D cycle by ID | |
| 43 | +| `get_dimension_guidance` | Antipatterns + examples for a dimension across all cycles | |
| 44 | +| `refresh_knowledge` | Re-fetch from the connector without restarting | |
| 45 | +| `contribute_cycle` | Validate and submit a new cycle to the knowledge source | |
72 | 46 |
|
73 | | -**Inputs:** |
74 | | -- `task_description` (string, required): Description of the problem or task |
75 | | -- `domain` (string, optional): Filter by domain (coding, writing, research, etc.) |
| 47 | +## Connectors |
76 | 48 |
|
77 | | -**Output:** Array of similar knowledge entries with similarity scores |
| 49 | +The server fetches knowledge from a configured source. Set `FLUENTLY_CONNECTOR` to choose. |
78 | 50 |
|
79 | | -### 2. score_delegation |
| 51 | +### github-public (default) |
80 | 52 |
|
81 | | -Scores the Delegation and Description dimensions with improvement advice. |
| 53 | +Fetches live from the public Fluently community repo. No auth required. Points to `faical-yannick-congo/fluently` by default. |
82 | 54 |
|
83 | | -**Inputs:** |
84 | | -- `task` (string, required): The task to evaluate |
85 | | -- `delegation_intent` (string, required): How you intend to delegate (automated, augmented, agentic) |
| 55 | +```bash |
| 56 | +# Default — no config needed |
| 57 | +4d-mcp-server |
86 | 58 |
|
87 | | -**Output:** Delegation + Description scores with specific improvement recommendations |
| 59 | +# Point to a public fork |
| 60 | +FLUENTLY_CONNECTOR=github-public \ |
| 61 | +FLUENTLY_GITHUB_REPO=your-org/your-public-fork \ |
| 62 | +4d-mcp-server |
| 63 | +``` |
88 | 64 |
|
89 | | -### 3. evaluate_discernment |
| 65 | +Contributing requires opening a PR manually (YAML + instructions returned by `contribute_cycle`). |
90 | 66 |
|
91 | | -Evaluates discernment for an AI output: hallucination risk, confidence calibration, and human review requirements. |
| 67 | +### github-private |
92 | 68 |
|
93 | | -**Inputs:** |
94 | | -- `ai_output` (string, required): The AI-generated output to evaluate |
95 | | -- `original_task` (string, required): The original task given to the AI |
| 69 | +Fetches from a private GitHub repo via the GitHub API. Requires a personal access token with `repo` scope. `contribute_cycle` creates branches and PRs automatically. |
96 | 70 |
|
97 | | -**Output:** Discernment score, hallucination risk percentage, confidence calibration, and human review guidance |
| 71 | +```bash |
| 72 | +FLUENTLY_CONNECTOR=github-private \ |
| 73 | +FLUENTLY_GITHUB_REPO=your-org/your-private-knowledge \ |
| 74 | +FLUENTLY_GITHUB_TOKEN=ghp_xxx \ |
| 75 | +4d-mcp-server |
| 76 | +``` |
98 | 77 |
|
99 | | -### 4. check_diligence |
| 78 | +### local |
100 | 79 |
|
101 | | -Returns a diligence checklist: transparency requirements, accountability steps, and disclosure needs. |
| 80 | +Reads from a local directory. Ideal for development, air-gapped environments, or building private cycles before committing. |
102 | 81 |
|
103 | | -**Inputs:** |
104 | | -- `task` (string, required): The task to evaluate |
105 | | -- `domain` (string, required): The domain context |
| 82 | +```bash |
| 83 | +FLUENTLY_CONNECTOR=local \ |
| 84 | +FLUENTLY_LOCAL_PATH=/path/to/your/knowledge \ |
| 85 | +4d-mcp-server |
| 86 | +``` |
106 | 87 |
|
107 | | -**Output:** Structured checklist for maintaining accountability and transparency |
| 88 | +`contribute_cycle` writes YAML files directly to the configured directory. |
108 | 89 |
|
109 | | -### 5. get_4d_score |
| 90 | +### sql _(planned)_ |
110 | 91 |
|
111 | | -Master tool returning a complete 4D Score (0-100 per dimension plus overall) with one-sentence improvement tips. |
| 92 | +Reads cycles from a SQL database (PostgreSQL, SQLite). Coming in a future release. |
112 | 93 |
|
113 | | -**Inputs:** |
114 | | -- `description` (string, required): Task description |
115 | | -- `delegation` (string, required): How the task is being delegated |
116 | | -- `output` (string, optional): AI output to evaluate for discernment |
| 94 | +### nosql _(planned)_ |
117 | 95 |
|
118 | | -**Output:** Complete 4D profile with scores and improvement guidance |
| 96 | +Reads cycles from a NoSQL database (MongoDB). Coming in a future release. |
119 | 97 |
|
120 | | -## Knowledge Base |
| 98 | +## Environment variables |
121 | 99 |
|
122 | | -The server loads knowledge entries from the `knowledge/` directory at the workspace root. Knowledge files are YAML and must follow the schema defined in `@fluently/scorer`. |
| 100 | +| Variable | Default | Description | |
| 101 | +|---|---|---| |
| 102 | +| `FLUENTLY_CONNECTOR` | `github-public` | Which connector to use | |
| 103 | +| `FLUENTLY_GITHUB_REPO` | `faical-yannick-congo/fluently` | GitHub repo (`owner/repo`) | |
| 104 | +| `FLUENTLY_GITHUB_BRANCH` | `main` | Branch to read from | |
| 105 | +| `FLUENTLY_GITHUB_TOKEN` | _(none)_ | GitHub token — required for private repos and automated PRs | |
| 106 | +| `FLUENTLY_LOCAL_PATH` | `./knowledge` | Local knowledge directory (local connector only) | |
123 | 107 |
|
124 | | -Each entry defines best practices and antipatterns for all four dimensions across different domains. |
| 108 | +## Why no scoring? |
125 | 109 |
|
126 | | -## Architecture |
| 110 | +Numeric scores (delegation: 34/100) are biased by writing style and user maturity. Two people describing the same workflow in different vocabulary get different scores. |
127 | 111 |
|
128 | | -- **Transport**: Stdio (primary) for local editor integration |
129 | | -- **Schema Validation**: via Zod in `@fluently/scorer` |
130 | | -- **Similarity Matching**: cosine similarity on keyword sets |
131 | | -- **Knowledge Loading**: dynamic from `knowledge/` directory at startup |
| 112 | +This server does **retrieval** — it finds the most relevant cycles using keyword similarity and returns them for you to reason over. You assess fit in context. That's more accurate and adapts to the specifics of the situation rather than returning a false-precision number. |
132 | 113 |
|
133 | | -## Development |
| 114 | +## Using GitHub MCP instead (community knowledge) |
134 | 115 |
|
135 | | -To add new tools, edit `src/index.ts` and: |
| 116 | +If you prefer to skip the custom server and work directly with the public knowledge base via GitHub MCP, read `KNOWLEDGE.md` at the repo root. The raw `index.json` is fetchable without auth and contains all cycles. |
136 | 117 |
|
137 | | -1. Define the Tool schema in a `*ToolDef` constant |
138 | | -2. Register it in the `tools/list` handler |
139 | | -3. Add the handler logic in the `tools/call` switch statement |
140 | | -4. Rebuild and test |
| 118 | +The custom MCP server is the right choice when: |
| 119 | +- You need private knowledge that stays in your org |
| 120 | +- You want isolation from the community repo |
| 121 | +- You want structured tools (domain listing, dimension guidance, contribute flow) |
| 122 | +- You need the server to handle sync and refresh automatically |
141 | 123 |
|
142 | 124 | ## License |
143 | 125 |
|
|
0 commit comments