Skip to content

Commit 028db56

Browse files
committed
Lots of cleanups
1 parent 975290c commit 028db56

14 files changed

+338
-1580
lines changed

AI_DEVELOPMENT_NOTES.md

Lines changed: 0 additions & 126 deletions
This file was deleted.

MCP_HTTP_USAGE.md

Lines changed: 86 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,61 @@
1-
# Aetheria MCP Server - HTTP Streaming Transport
1+
# Aetheria MCP Server - HTTP Access Guide
22

3-
The Aetheria MCP (Model Context Protocol) server now uses HTTP streaming transport instead of stdio, making it easier to integrate with web applications and HTTP clients.
3+
The Aetheria MCP (Model Context Protocol) server serves static world reference documentation as markdown files. It supports both stdio and HTTP transports.
44

55
## Starting the Server
66

7+
### Development Mode (stdio transport)
78
```bash
8-
cd site
9-
npm run mcp
9+
cd mcp-server
10+
npm run dev
1011
```
1112

12-
The server will start on port 3001 and bind to all network interfaces (0.0.0.0) by default. You can customize the configuration with environment variables:
13+
### HTTP Mode (for web integration)
14+
```bash
15+
cd mcp-server
16+
npm run build
17+
npm run start-http
18+
```
19+
20+
The HTTP server will start on port 3000 and bind to all network interfaces (0.0.0.0) by default. You can customize with environment variables:
1321

1422
```bash
1523
# Change port
16-
MCP_PORT=8080 npm run mcp
24+
MCP_PORT=8080 npm run start-http
1725

1826
# Bind to specific interface (localhost only)
19-
MCP_HOST=127.0.0.1 npm run mcp
20-
21-
# Bind to all interfaces (default)
22-
MCP_HOST=0.0.0.0 npm run mcp
27+
MCP_HOST=127.0.0.1 npm run start-http
2328

2429
# Custom port and host
25-
MCP_HOST=192.168.1.100 MCP_PORT=8080 npm run mcp
30+
MCP_HOST=192.168.1.100 MCP_PORT=8080 npm run start-http
2631
```
2732

2833
## Network Access
2934

30-
By default, the server binds to `0.0.0.0:3001`, making it accessible from:
31-
- **Local machine**: `http://localhost:3001`
32-
- **Local network**: `http://[your-ip]:3001`
33-
- **Docker/containers**: `http://0.0.0.0:3001`
34-
35-
If you want to restrict access to localhost only, set `MCP_HOST=127.0.0.1`.
35+
By default, the HTTP server binds to `0.0.0.0:3000`, making it accessible from:
36+
- **Local machine**: `http://localhost:3000`
37+
- **Local network**: `http://[your-ip]:3000`
38+
- **Docker/containers**: `http://0.0.0.0:3000`
3639

3740
## Endpoints
3841

3942
### SSE (Server-Sent Events) Endpoint
40-
- **URL**: `http://localhost:3001`
43+
- **URL**: `http://localhost:3000`
4144
- **Method**: GET
4245
- **Headers**: `Accept: text/event-stream`
43-
- **Use case**: For persistent connections and real-time streaming
4446

4547
### JSON-RPC Endpoint
46-
- **URL**: `http://localhost:3001`
48+
- **URL**: `http://localhost:3000`
4749
- **Method**: POST
48-
- **Headers**:
49-
- `Content-Type: application/json`
50-
- `Accept: application/json, text/event-stream`
50+
- **Headers**: `Content-Type: application/json`
5151

5252
## Example Usage
5353

5454
### 1. Initialize the MCP Server
5555

5656
```bash
57-
curl -X POST http://localhost:3001 \
57+
curl -X POST http://localhost:3000 \
5858
-H "Content-Type: application/json" \
59-
-H "Accept: application/json, text/event-stream" \
6059
-d '{
6160
"jsonrpc": "2.0",
6261
"id": 1,
@@ -65,7 +64,7 @@ curl -X POST http://localhost:3001 \
6564
"protocolVersion": "2024-11-05",
6665
"capabilities": {},
6766
"clientInfo": {
68-
"name": "your-client",
67+
"name": "aetheria-client",
6968
"version": "1.0.0"
7069
}
7170
}
@@ -75,9 +74,8 @@ curl -X POST http://localhost:3001 \
7574
### 2. List Available Resources
7675

7776
```bash
78-
curl -X POST http://localhost:3001 \
77+
curl -X POST http://localhost:3000 \
7978
-H "Content-Type: application/json" \
80-
-H "Accept: application/json, text/event-stream" \
8179
-d '{
8280
"jsonrpc": "2.0",
8381
"id": 2,
@@ -89,70 +87,100 @@ curl -X POST http://localhost:3001 \
8987
### 3. Read a Resource
9088

9189
```bash
92-
curl -X POST http://localhost:3001 \
90+
curl -X POST http://localhost:3000 \
9391
-H "Content-Type: application/json" \
94-
-H "Accept: application/json, text/event-stream" \
9592
-d '{
9693
"jsonrpc": "2.0",
9794
"id": 3,
9895
"method": "resources/read",
9996
"params": {
100-
"uri": "aetheria://pages/magic"
97+
"uri": "aetheria://page",
98+
"arguments": {
99+
"page": "magic"
100+
}
101101
}
102102
}'
103103
```
104104

105-
### 4. Use Search Tool
105+
### 4. List Available Tools
106106

107107
```bash
108-
curl -X POST http://localhost:3001 \
108+
curl -X POST http://localhost:3000 \
109109
-H "Content-Type: application/json" \
110-
-H "Accept: application/json, text/event-stream" \
111110
-d '{
112111
"jsonrpc": "2.0",
113112
"id": 4,
113+
"method": "tools/list",
114+
"params": {}
115+
}'
116+
```
117+
118+
### 5. Use Search Tool
119+
120+
```bash
121+
curl -X POST http://localhost:3000 \
122+
-H "Content-Type: application/json" \
123+
-d '{
124+
"jsonrpc": "2.0",
125+
"id": 5,
114126
"method": "tools/call",
115127
"params": {
116-
"name": "search_aetheria_pages",
128+
"name": "search_pages",
117129
"arguments": {
118-
"query": "magic schools"
130+
"query": "magic schools",
131+
"maxResults": 10
119132
}
120133
}
121134
}'
122135
```
123136

124137
## Features
125138

126-
- **Session Management**: Each connection gets a unique session ID for state management
127-
- **CORS Enabled**: The server allows cross-origin requests for web integration
128-
- **SSE Streaming**: Real-time event streaming for persistent connections
129-
- **JSON-RPC**: Standard JSON-RPC 2.0 protocol for request/response
130-
- **Puppeteer Integration**: Renders live page content from the Aetheria website
131-
- **Dynamic Resources**: Access to all Aetheria pages (magic, classes, equipment, etc.)
132-
- **Search Capability**: Search across all rendered page content
139+
- **Static File Serving**: Fast, reliable markdown file serving
140+
- **Session Management**: UUID-based session tracking
141+
- **CORS Enabled**: Cross-origin requests supported
142+
- **Dual Transport**: Both stdio and HTTP transport options
143+
- **Documentation Generation**: Serves pre-generated markdown docs
144+
- **Search Capability**: Full-text search across all content
133145

134146
## Available Resources
135147

136-
The server provides access to the following Aetheria pages:
137-
- `aetheria://pages/magic` - Magic system information
138-
- `aetheria://pages/classes` - Character classes
139-
- `aetheria://pages/equipment` - Equipment and items
140-
- `aetheria://pages/politics` - Political systems
141-
- `aetheria://pages/alignment` - Alignment system
142-
- `aetheria://pages/religion` - Religious information
143-
- `aetheria://pages/relationships` - Character relationships
148+
The server provides a single resource endpoint:
149+
- `aetheria://page` - Get any page from the Aetheria world reference
150+
151+
Available pages include:
152+
- `alignment` - Character alignment system
153+
- `classes` - Character classes and specializations
154+
- `equipment` - Weapons, armor, and items
155+
- `magic` - Magic schools and spells
156+
- `politics` - Political systems and organizations
157+
- `religion` - Deities and religious systems
158+
- `relationships` - Character relationships
159+
- `skills` - Skills and abilities
160+
- `index` - Main overview page
144161

145162
## Available Tools
146163

147-
- `search_aetheria_pages` - Search across all Aetheria content for specific terms
164+
- `search_pages` - Search across all Aetheria documentation
165+
- `get_page_hierarchy` - Get structured page hierarchy
166+
- `generate_character_sheet` - Generate character sheets (if available)
167+
- `extract_entities` - Extract specific entity types
148168

149169
## Technical Details
150170

151-
- **Transport**: HTTP Streaming (SSE + JSON-RPC)
171+
- **Architecture**: Simple file-based serving (no browser automation)
152172
- **Protocol**: Model Context Protocol (MCP) 2024-11-05
153-
- **Session**: UUID-based session management
154-
- **Rendering**: Puppeteer for dynamic content extraction
155-
- **CORS**: Enabled for cross-origin access
156-
- **Port**: 3001 (configurable via MCP_PORT)
173+
- **Transport**: HTTP Streaming + stdio options
174+
- **Performance**: Fast static file serving
175+
- **Dependencies**: Minimal (no Puppeteer, no heavy frameworks)
176+
- **Data Source**: Pre-generated markdown files in `/docs` directory
177+
- **Port**: 3000 (configurable via MCP_PORT)
178+
179+
## Development Workflow
180+
181+
1. **Generate docs**: Content is generated from the SolidJS site
182+
2. **Build server**: `npm run build` compiles TypeScript
183+
3. **Start server**: `npm run start-http` for HTTP access
184+
4. **Test**: Use curl commands above to verify functionality
157185

158-
The server automatically handles session initialization, cleanup, and provides both streaming and request/response modes depending on the client needs.
186+
The server is lightweight, fast, and reliable - perfect for AI model integration without the complexity of browser automation.

0 commit comments

Comments
 (0)