Skip to content

Commit e42ad32

Browse files
committed
docs: add info about api and capabilities
1 parent 9089098 commit e42ad32

File tree

1 file changed

+69
-10
lines changed

1 file changed

+69
-10
lines changed

mcp-server/README.md

Lines changed: 69 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,66 @@ This is an auth-less Model Context Protocol (MCP) server designed to run on Clou
66

77
This server acts as a backend component, enabling integrations that require dynamic access to specific coding guidelines or standards.
88

9-
## 2. Project Scope & Functionality
9+
## 2. Available MCP Tools
10+
11+
This server exposes the following tools according to the Model Context Protocol (MCP). These tools allow AI assistants or clients to discover and retrieve AI coding rules.
12+
13+
### 2.1 `listAvailableRules`
14+
15+
* **Description**: Lists all available rule sets (libraries) that can be fetched. It returns the unique `identifier` for each rule set, its `name`, and its categorical `stack`.
16+
* **Input**: None.
17+
* **Output Schema**: The tool returns a JSON object structured like this:
18+
```json
19+
{
20+
"availableLibraries": [
21+
{
22+
"identifier": "string", // e.g., "ASP_NET"
23+
"name": "string", // e.g., "ASP.NET"
24+
"stack": ["string"] // e.g., ["Backend", ".NET"]
25+
},
26+
{
27+
"identifier": "SPRING_BOOT",
28+
"name": "Spring Boot",
29+
"stack": ["Backend", "Java"]
30+
}
31+
// ... other libraries
32+
],
33+
"reminder": "string" // e.g., "Use the 'getRuleContent' tool..."
34+
}
35+
```
36+
* **Example Interaction**: An AI assistant calls this tool. The response provides the structured list. The assistant might then present this list to the user, potentially using the `stack` for grouping (e.g., showing Backend > .NET > ASP_NET).
37+
38+
### 2.2 `getRuleContent`
39+
40+
* **Description**: Retrieves the specific set of AI coding rules for a given library identifier.
41+
* **Input Schema**:
42+
```json
43+
{
44+
"libraryIdentifier": "string" // e.g., "VUE_CODING_STANDARDS"
45+
}
46+
```
47+
* **Output Schema (Success)**: The tool returns a JSON object containing an array of rule strings:
48+
```json
49+
{
50+
"rules": [
51+
"string", // e.g., "Use the Composition API..."
52+
"string" // e.g., "Implement <script setup>..."
53+
// ... more rule strings
54+
]
55+
}
56+
```
57+
* **Output Schema (Error)**:
58+
```json
59+
{
60+
"error": "string" // Description of the error
61+
}
62+
```
63+
* **Example Interaction**: An AI assistant is asked for rules using an identifier (e.g., `VUE_CODING_STANDARDS`).
64+
1. Assistant calls the tool with input: `{"libraryIdentifier": "VUE_CODING_STANDARDS"}`.
65+
2. Tool responds with: `{"rules": ["Use the Composition API...", "Implement <script setup>..."]}`.
66+
3. Assistant presents the rules from the `rules` array to the user, potentially formatting them as requested (e.g., as a Markdown list).
67+
68+
## 3. Project Scope & Functionality
1069

1170
- **MCP Implementation**: Adheres to the Model Context Protocol standard.
1271
- **Cloudflare Worker**: Designed to be deployed and run efficiently on the Cloudflare edge network.
@@ -17,7 +76,7 @@ This server acts as a backend component, enabling integrations that require dyna
1776
- `getRuleContent`: Takes a library identifier and returns the specific set of rules associated with it. Reads data from `preparedRules.json` via `src/data/rulesProvider.ts`.
1877
- **(Potential) Tool Customization**: The original template README mentioned customizing tools in `src/index.ts`. Refer to that file for details on adding or modifying tools.
1978

20-
## 3. Using the MCP Server
79+
## 4. Using the MCP Server
2180

2281
### Production Usage (Recommended)
2382

@@ -65,7 +124,7 @@ After configuring, restart your editor. The `listAvailableRules` and `getRuleCon
65124

66125
This setup is useful for developing or modifying the MCP server itself.
67126

68-
**Endpoint:** `http://localhost:8787/sse` (available after running `npm run dev` in the `mcp-server` directory, see Section 5).
127+
**Endpoint:** `http://localhost:8787/sse` (available after running `npm run dev` in the `mcp-server` directory, see Section 7).
69128

70129
**Connecting Clients:**
71130

@@ -75,7 +134,7 @@ This setup is useful for developing or modifying the MCP server itself.
75134

76135
Use the **MCP Inspector** pointed at the local URL (`http://localhost:8787/sse`) to debug tool calls during development.
77136

78-
## 4. Tech Stack
137+
## 5. Tech Stack
79138

80139
- **Runtime**: Cloudflare Workers
81140
- **Language**: TypeScript
@@ -88,7 +147,7 @@ Use the **MCP Inspector** pointed at the local URL (`http://localhost:8787/sse`)
88147
- **Linting & Formatting**:
89148
- `biome`: Used for code formatting and linting.
90149

91-
## 5. Getting Started Locally
150+
## 6. Getting Started Locally
92151

93152
### Prerequisites
94153

@@ -121,7 +180,7 @@ Use the **MCP Inspector** pointed at the local URL (`http://localhost:8787/sse`)
121180
```
122181
The server will typically be available at `http://localhost:8787`. The MCP endpoint is usually `/sse` (e.g., `http://localhost:8787/sse`).
123182

124-
## 6. Available Scripts
183+
## 7. Available Scripts
125184

126185
The following scripts are available via `npm run <script_name>`:
127186

@@ -132,7 +191,7 @@ The following scripts are available via `npm run <script_name>`:
132191
- `lint:fix`: Lints the code using Biome and attempts to automatically fix issues.
133192
- `cf-typegen`: Generates TypeScript types for Cloudflare environment bindings (like KV namespaces, Durable Objects, etc., if configured).
134193

135-
## 7. Deployment
194+
## 8. Deployment
136195

137196
This project uses GitHub Actions for Continuous Integration and Continuous Deployment (CI/CD).
138197

@@ -151,18 +210,18 @@ For the deployment to succeed, the following secrets must be configured in the G
151210
- `CLOUDFLARE_WORKER_TOKEN`: An API token with permissions to deploy Cloudflare Workers.
152211
- `CLOUDFLARE_ACCOUNT_ID`: Your Cloudflare account ID.
153212

154-
## 8. Planned Features
213+
## 9. Planned Features
155214

156215
The following features are planned for future development:
157216

158217
- **Create Cursor Rule Tool:** An MCP tool that allows creating or modifying a Cursor AI rule file directly within the user's host workspace.
159218
- **Propose Rule via PR Tool:** An MCP tool enabling users to select a rule or modification from their host environment and automatically create a Pull Request in the main repository to propose adding/updating it.
160219

161-
## 9. Project Status
220+
## 10. Project Status
162221

163222
- **Version**: `0.0.1` (as per `package.json`)
164223
- **Status**: Initial development.
165224

166-
## 10. License
225+
## 11. License
167226

168227
AGPL

0 commit comments

Comments
 (0)