@answer-engine/mcp-server 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +211 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# @answer-engine/mcp-server
|
|
2
|
+
|
|
3
|
+
[Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for [Answer Engine](https://github.com/the-answerai/answer-engine) — gives AI assistants like Claude access to your content library.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @answer-engine/mcp-server
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
### Claude Desktop
|
|
14
|
+
|
|
15
|
+
Add to your `claude_desktop_config.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"answer-engine": {
|
|
21
|
+
"command": "answer-engine-mcp",
|
|
22
|
+
"env": {
|
|
23
|
+
"ANSWER_ENGINE_API_KEY": "ae_live_your_key_here",
|
|
24
|
+
"ANSWER_ENGINE_API_URL": "http://localhost:5050"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Config file locations:
|
|
32
|
+
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
33
|
+
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
34
|
+
|
|
35
|
+
### Cursor
|
|
36
|
+
|
|
37
|
+
Add to your Cursor MCP settings (`.cursor/mcp.json`):
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"mcpServers": {
|
|
42
|
+
"answer-engine": {
|
|
43
|
+
"command": "answer-engine-mcp",
|
|
44
|
+
"env": {
|
|
45
|
+
"ANSWER_ENGINE_API_KEY": "ae_live_your_key_here",
|
|
46
|
+
"ANSWER_ENGINE_API_URL": "http://localhost:5050"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### npx (no install)
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"mcpServers": {
|
|
58
|
+
"answer-engine": {
|
|
59
|
+
"command": "npx",
|
|
60
|
+
"args": ["-y", "@answer-engine/mcp-server"],
|
|
61
|
+
"env": {
|
|
62
|
+
"ANSWER_ENGINE_API_KEY": "ae_live_your_key_here",
|
|
63
|
+
"ANSWER_ENGINE_API_URL": "http://localhost:5050"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Configuration
|
|
71
|
+
|
|
72
|
+
| Environment Variable | Description | Default |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| `ANSWER_ENGINE_API_KEY` | Your Answer Engine API key (required) | — |
|
|
75
|
+
| `ANSWER_ENGINE_API_URL` | API base URL | `http://localhost:5050` |
|
|
76
|
+
|
|
77
|
+
## Tools
|
|
78
|
+
|
|
79
|
+
The MCP server exposes 7 tools that AI assistants can call:
|
|
80
|
+
|
|
81
|
+
### search_content
|
|
82
|
+
|
|
83
|
+
Search your content library using fulltext, semantic, or hybrid search.
|
|
84
|
+
|
|
85
|
+
| Parameter | Type | Required | Description |
|
|
86
|
+
|---|---|---|---|
|
|
87
|
+
| `query` | string | Yes | Search query text |
|
|
88
|
+
| `searchType` | enum | No | `hybrid` (default), `fulltext`, `semantic` |
|
|
89
|
+
| `limit` | number | No | Max results (1-50, default 10) |
|
|
90
|
+
| `include` | string[] | No | Fields: `summary`, `content`, `tags`, `metadata` |
|
|
91
|
+
| `filters.contentTypes` | string[] | No | Filter by content types |
|
|
92
|
+
| `filters.tags` | string[] | No | Filter by tag slugs |
|
|
93
|
+
| `filters.dateFrom` | string | No | ISO date — created after |
|
|
94
|
+
| `filters.dateTo` | string | No | ISO date — created before |
|
|
95
|
+
|
|
96
|
+
**Cost:** 1 credit
|
|
97
|
+
|
|
98
|
+
### get_content
|
|
99
|
+
|
|
100
|
+
Retrieve specific content items by ID.
|
|
101
|
+
|
|
102
|
+
| Parameter | Type | Required | Description |
|
|
103
|
+
|---|---|---|---|
|
|
104
|
+
| `ids` | string[] | Yes | Content item UUIDs (1-50) |
|
|
105
|
+
| `include` | string[] | No | Fields: `summary`, `content`, `tags`, `metadata`, `children`, `analysis` |
|
|
106
|
+
|
|
107
|
+
**Cost:** 1 credit
|
|
108
|
+
|
|
109
|
+
### list_tags
|
|
110
|
+
|
|
111
|
+
List all available tags, content types, and capabilities. Useful for discovering what's in your library before searching.
|
|
112
|
+
|
|
113
|
+
No parameters required.
|
|
114
|
+
|
|
115
|
+
**Cost:** Free (0 credits)
|
|
116
|
+
|
|
117
|
+
### summarize_collection
|
|
118
|
+
|
|
119
|
+
Use AI to summarize or analyze content from your library.
|
|
120
|
+
|
|
121
|
+
| Parameter | Type | Required | Description |
|
|
122
|
+
|---|---|---|---|
|
|
123
|
+
| `prompt` | string | Yes | What to summarize or analyze |
|
|
124
|
+
| `filter.contentTypes` | string[] | No | Filter by content types |
|
|
125
|
+
| `filter.tags` | string[] | No | Filter by tag slugs |
|
|
126
|
+
| `filter.dateFrom` | string | No | ISO date filter |
|
|
127
|
+
| `filter.dateTo` | string | No | ISO date filter |
|
|
128
|
+
| `limit` | number | No | Max items to analyze (1-100, default 20) |
|
|
129
|
+
|
|
130
|
+
**Cost:** 10 credits
|
|
131
|
+
|
|
132
|
+
### scrape_url
|
|
133
|
+
|
|
134
|
+
Scrape a web page and save it to your content library.
|
|
135
|
+
|
|
136
|
+
| Parameter | Type | Required | Description |
|
|
137
|
+
|---|---|---|---|
|
|
138
|
+
| `url` | string | Yes | URL to scrape |
|
|
139
|
+
| `includeHtml` | boolean | No | Include raw HTML (default false) |
|
|
140
|
+
|
|
141
|
+
**Cost:** 1 credit
|
|
142
|
+
|
|
143
|
+
### crawl_domain
|
|
144
|
+
|
|
145
|
+
Crawl multiple pages from a domain.
|
|
146
|
+
|
|
147
|
+
| Parameter | Type | Required | Description |
|
|
148
|
+
|---|---|---|---|
|
|
149
|
+
| `domain` | string | Yes | Domain to crawl (e.g., `example.com`) |
|
|
150
|
+
| `maxPages` | number | No | Max pages (1-100, default 10) |
|
|
151
|
+
|
|
152
|
+
**Cost:** 1 credit per page
|
|
153
|
+
|
|
154
|
+
### web_search
|
|
155
|
+
|
|
156
|
+
Search the web and optionally scrape full content from results.
|
|
157
|
+
|
|
158
|
+
| Parameter | Type | Required | Description |
|
|
159
|
+
|---|---|---|---|
|
|
160
|
+
| `query` | string | Yes | Search query |
|
|
161
|
+
| `site` | string | No | Limit to specific site |
|
|
162
|
+
| `scrapeResults` | boolean | No | Scrape content from result URLs (default false) |
|
|
163
|
+
|
|
164
|
+
**Cost:** 1 credit
|
|
165
|
+
|
|
166
|
+
## Resources
|
|
167
|
+
|
|
168
|
+
The server also exposes 2 MCP resources:
|
|
169
|
+
|
|
170
|
+
| Resource | URI | Description |
|
|
171
|
+
|---|---|---|
|
|
172
|
+
| Content Schema | `answer-engine://schema` | Content types, tags, capabilities, date range |
|
|
173
|
+
| Content Item | `answer-engine://content/{id}` | Full content item by ID |
|
|
174
|
+
|
|
175
|
+
## Error Handling
|
|
176
|
+
|
|
177
|
+
Errors are returned with `isError: true` in the MCP response with clear messages:
|
|
178
|
+
|
|
179
|
+
| HTTP Status | Error Message |
|
|
180
|
+
|---|---|
|
|
181
|
+
| 401 | Authentication failed. Check your ANSWER_ENGINE_API_KEY. |
|
|
182
|
+
| 402 | Insufficient credits. |
|
|
183
|
+
| 429 | Rate limit exceeded. |
|
|
184
|
+
|
|
185
|
+
Every successful response includes credit usage:
|
|
186
|
+
```
|
|
187
|
+
Credits charged: 1 | Credits remaining: 99
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Development
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# Clone the repo
|
|
194
|
+
git clone https://github.com/the-answerai/answer-engine.git
|
|
195
|
+
cd answer-engine
|
|
196
|
+
|
|
197
|
+
# Install and build
|
|
198
|
+
pnpm install
|
|
199
|
+
pnpm mcp-server:build
|
|
200
|
+
|
|
201
|
+
# Test with stdio
|
|
202
|
+
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | \
|
|
203
|
+
ANSWER_ENGINE_API_KEY=your_key node packages/mcp-server/dist/index.js
|
|
204
|
+
|
|
205
|
+
# Run tests
|
|
206
|
+
cd packages/mcp-server && pnpm test
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## License
|
|
210
|
+
|
|
211
|
+
MIT
|