You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then configure your AI assistant to use the MCP server with STDIO transport.
95
+
Then configure your AI assistant to use the MCP server with STDIO transport. The binary is available as `mcp-atlassian-confluence` after global installation.
87
96
88
97
### Alternative: Configuration File
89
98
@@ -103,6 +112,25 @@ Create `~/.mcp/configs.json` for system-wide configuration:
103
112
104
113
**Alternative config keys:** The system also accepts `"atlassian-confluence"`, `"@aashari/mcp-server-atlassian-confluence"`, or `"mcp-server-atlassian-confluence"` instead of `"confluence"`.
105
114
115
+
### Using Environment Variables
116
+
117
+
You can also configure credentials using environment variables or a `.env` file:
118
+
119
+
```bash
120
+
# Create a .env file in your project directory
121
+
cat > .env <<EOF
122
+
ATLASSIAN_SITE_NAME=your-company
123
+
ATLASSIAN_USER_EMAIL=your.email@company.com
124
+
ATLASSIAN_API_TOKEN=your_api_token
125
+
DEBUG=false
126
+
EOF
127
+
```
128
+
129
+
The server will automatically load these values from:
130
+
1. Environment variables
131
+
2.`.env` file in the current directory
132
+
3.`~/.mcp/configs.json` (as shown above)
133
+
106
134
## Available Tools
107
135
108
136
This MCP server provides 5 generic tools that can access any Confluence API endpoint:
@@ -112,8 +140,21 @@ This MCP server provides 5 generic tools that can access any Confluence API endp
112
140
|`conf_get`| GET any Confluence API endpoint (read data) |
113
141
|`conf_post`| POST to any endpoint (create resources) |
114
142
|`conf_put`| PUT to any endpoint (replace resources) |
115
-
|`conf_patch`| PATCH any endpoint (partial updates) |
116
-
|`conf_delete`| DELETE any endpoint (remove resources) |
143
+
|`conf_patch`| PATCH to any endpoint (partial updates) |
144
+
|`conf_delete`| DELETE from any endpoint (remove resources) |
145
+
146
+
### Tool Parameters
147
+
148
+
All tools share these common parameters:
149
+
150
+
-**`path`** (required): The API endpoint path (e.g., `/wiki/api/v2/spaces`)
**What is TOON?** TOON (Token-Oriented Object Notation) is a format optimized for LLM token efficiency, reducing token costs by 30-60% compared to JSON. It's the default output format for all tools.
187
+
188
+
**Benefits:**
189
+
- Tabular arrays use fewer tokens than JSON arrays
190
+
- Minimal syntax overhead (no quotes, brackets, commas where unnecessary)
To use JSON instead of TOON, set `outputFormat: "json"` in your request.
211
+
143
212
### JMESPath Filtering
144
213
145
-
All tools support optional JMESPath (`jq`) filtering to extract specific data:
214
+
All tools support optional JMESPath (`jq`) filtering to extract specific data and reduce token costs:
146
215
147
216
```bash
148
217
# Get just space names and keys
@@ -156,6 +225,17 @@ npx -y @aashari/mcp-server-atlassian-confluence get \
156
225
--jq "{id: id, title: title, status: status}"
157
226
```
158
227
228
+
**IMPORTANT:** Always use the `jq` parameter to filter responses to only the fields you need. Unfiltered responses can be very large and expensive in token costs.
229
+
230
+
**JMESPath Syntax Reference:**
231
+
- Official docs: [jmespath.org](https://jmespath.org)
232
+
- Common patterns:
233
+
-`results[*]` - All items in results array
234
+
-`results[0]` - First item only
235
+
-`results[*].id` - Just IDs from all items
236
+
-`results[*].{id: id, title: title}` - Create objects with selected fields
237
+
-`results[?status=='current']` - Filter by condition
238
+
159
239
## Real-World Examples
160
240
161
241
### Explore Your Knowledge Base
@@ -191,16 +271,43 @@ Ask your AI assistant:
191
271
192
272
## CLI Commands
193
273
194
-
The CLI mirrors the MCP tools for direct terminal access:
274
+
The CLI mirrors the MCP tools for direct terminal access. All commands support the same parameters as the tools.
275
+
276
+
### Available Commands
277
+
278
+
-`get` - GET any Confluence endpoint
279
+
-`post` - POST to any endpoint
280
+
-`put` - PUT to any endpoint
281
+
-`patch` - PATCH any endpoint
282
+
-`delete` - DELETE from any endpoint
283
+
284
+
### CLI Parameters
285
+
286
+
**All commands:**
287
+
-`-p, --path <path>` (required) - API endpoint path
288
+
-`-q, --query-params <json>` (optional) - Query parameters as JSON
When API responses exceed approximately 40,000 characters (~10,000 tokens), the server automatically truncates the response to stay within token limits. When this happens:
342
+
343
+
1.**You'll see a truncation notice** at the end of the response showing:
344
+
- How much of the original response is shown
345
+
- The original response size
346
+
- Guidance on accessing the full data
347
+
348
+
2.**The full raw response is saved** to a temporary file in `/tmp/mcp/` (path provided in the truncation notice)
349
+
350
+
3.**Best practices to avoid truncation:**
351
+
-**Always use the `jq` parameter** to filter responses to only needed fields
352
+
- Use `limit` query parameter to restrict result counts (e.g., `{"limit": "5"}`)
353
+
- Request specific resources by ID rather than listing all
354
+
- Use targeted CQL queries for searches
355
+
356
+
**Example of efficient filtering:**
357
+
```bash
358
+
# Instead of getting all space data (can be huge):
359
+
npx -y @aashari/mcp-server-atlassian-confluence get \
360
+
--path "/wiki/api/v2/spaces"
361
+
362
+
# Get only the fields you need:
363
+
npx -y @aashari/mcp-server-atlassian-confluence get \
364
+
--path "/wiki/api/v2/spaces" \
365
+
--query-params '{"limit": "10"}' \
366
+
--jq "results[*].{id: id, key: key, name: name}"
367
+
```
368
+
369
+
### Debug Logging
370
+
371
+
Enable debug logging to see detailed request/response information:
0 commit comments