nextcloud-mcp-server 0.17.1__tar.gz
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.
- nextcloud_mcp_server-0.17.1/PKG-INFO +315 -0
- nextcloud_mcp_server-0.17.1/README.md +282 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/__init__.py +0 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/app.py +591 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/auth/__init__.py +14 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/auth/bearer_auth.py +34 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/auth/client_registration.py +261 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/auth/context_helper.py +65 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/auth/token_verifier.py +207 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/client/__init__.py +136 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/client/base.py +104 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/client/calendar.py +1166 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/client/contacts.py +438 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/client/cookbook.py +250 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/client/deck.py +613 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/client/groups.py +151 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/client/notes.py +210 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/client/sharing.py +208 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/client/tables.py +125 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/client/users.py +223 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/client/webdav.py +948 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/config.py +53 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/context.py +51 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/controllers/__init__.py +1 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/controllers/notes_search.py +102 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/models/__init__.py +142 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/models/base.py +48 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/models/calendar.py +250 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/models/contacts.py +130 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/models/cookbook.py +220 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/models/deck.py +268 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/models/notes.py +85 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/models/tables.py +142 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/models/users.py +41 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/models/webdav.py +121 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/server/__init__.py +19 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/server/calendar.py +1009 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/server/contacts.py +82 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/server/cookbook.py +594 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/server/deck.py +584 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/server/notes.py +396 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/server/sharing.py +134 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/server/tables.py +57 -0
- nextcloud_mcp_server-0.17.1/nextcloud_mcp_server/server/webdav.py +343 -0
- nextcloud_mcp_server-0.17.1/pyproject.toml +99 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: nextcloud-mcp-server
|
|
3
|
+
Version: 0.17.1
|
|
4
|
+
Summary: Model Context Protocol (MCP) server for Nextcloud integration - enables AI assistants to interact with Nextcloud data
|
|
5
|
+
Keywords: nextcloud,mcp,model-context-protocol,llm,ai,claude,webdav,caldav,carddav
|
|
6
|
+
Author: Chris Coutinho
|
|
7
|
+
Author-email: Chris Coutinho <chris@coutinho.io>
|
|
8
|
+
License: AGPL-3.0-only
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
16
|
+
Classifier: Topic :: Communications
|
|
17
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
18
|
+
Requires-Dist: mcp[cli]>=1.18,<1.19
|
|
19
|
+
Requires-Dist: httpx>=0.28.1,<0.29.0
|
|
20
|
+
Requires-Dist: pillow>=12.0.0,<12.1.0
|
|
21
|
+
Requires-Dist: icalendar>=6.0.0,<7.0.0
|
|
22
|
+
Requires-Dist: pythonvcard4>=0.2.0
|
|
23
|
+
Requires-Dist: pydantic>=2.11.4
|
|
24
|
+
Requires-Dist: click>=8.1.8
|
|
25
|
+
Requires-Dist: caldav
|
|
26
|
+
Requires-Python: >=3.11
|
|
27
|
+
Project-URL: Bug Tracker, https://github.com/cbcoutinho/nextcloud-mcp-server/issues
|
|
28
|
+
Project-URL: Changelog, https://github.com/cbcoutinho/nextcloud-mcp-server/blob/master/CHANGELOG.md
|
|
29
|
+
Project-URL: Documentation, https://github.com/cbcoutinho/nextcloud-mcp-server#readme
|
|
30
|
+
Project-URL: Homepage, https://github.com/cbcoutinho/nextcloud-mcp-server
|
|
31
|
+
Project-URL: Repository, https://github.com/cbcoutinho/nextcloud-mcp-server
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# Nextcloud MCP Server
|
|
35
|
+
|
|
36
|
+
[](https://github.com/cbcoutinho/nextcloud-mcp-server/pkgs/container/nextcloud-mcp-server)
|
|
37
|
+
|
|
38
|
+
**Enable AI assistants to interact with your Nextcloud instance.**
|
|
39
|
+
|
|
40
|
+
The Nextcloud MCP (Model Context Protocol) server allows Large Language Models like Claude, GPT, and Gemini to interact with your Nextcloud data through a secure API. Create notes, manage calendars, organize contacts, work with files, and more - all through natural language.
|
|
41
|
+
|
|
42
|
+
> [!NOTE]
|
|
43
|
+
> **Nextcloud has two ways to enable AI access:** Nextcloud provides [Context Agent](https://github.com/nextcloud/context_agent), an AI agent backend that powers the [Assistant](https://github.com/nextcloud/assistant) app and allows AI to interact with Nextcloud apps like Calendar, Talk, and Contacts. Context Agent runs as an ExApp inside Nextcloud and also exposes an MCP server endpoint for external LLMs. This project (Nextcloud MCP Server) is a **dedicated standalone MCP server** designed specifically for external MCP clients like Claude Code and IDEs, with deep CRUD operations and OAuth support.
|
|
44
|
+
|
|
45
|
+
### High-level Comparison: Nextcloud MCP Server vs. Nextcloud AI Stack
|
|
46
|
+
|
|
47
|
+
| Aspect | **Nextcloud MCP Server**<br/>(This Project) | **Nextcloud AI Stack**<br/>(Assistant + Context Agent) |
|
|
48
|
+
|--------|---------------------------------------------|--------------------------------------------------------|
|
|
49
|
+
| **Purpose** | External MCP client access to Nextcloud | AI assistance within Nextcloud UI |
|
|
50
|
+
| **Deployment** | Standalone (Docker, VM, K8s) | Inside Nextcloud (ExApp via AppAPI) |
|
|
51
|
+
| **Primary Users** | Claude Code, IDEs, external developers | Nextcloud end users via Assistant app |
|
|
52
|
+
| **Authentication** | OAuth2/OIDC or Basic Auth | Session-based (integrated) |
|
|
53
|
+
| **Notes Support** | ✅ Full CRUD + search (7 tools) | ❌ Not implemented |
|
|
54
|
+
| **Calendar** | ✅ Full CalDAV + tasks (20+ tools) | ✅ Events, free/busy, tasks (4 tools) |
|
|
55
|
+
| **Contacts** | ✅ Full CardDAV (8 tools) | ✅ Find person, current user (2 tools) |
|
|
56
|
+
| **Files (WebDAV)** | ✅ Full filesystem access (12 tools) | ✅ Read, folder tree, sharing (3 tools) |
|
|
57
|
+
| **Deck** | ✅ Full project management (15 tools) | ✅ Basic board/card ops (2 tools) |
|
|
58
|
+
| **Tables** | ✅ Row operations (5 tools) | ❌ Not implemented |
|
|
59
|
+
| **Cookbook** | ✅ Full recipe management (13 tools) | ❌ Not implemented |
|
|
60
|
+
| **Talk** | ❌ Not implemented | ✅ Messages, conversations (4 tools) |
|
|
61
|
+
| **Mail** | ❌ Not implemented | ✅ Send email (2 tools) |
|
|
62
|
+
| **AI Features** | ❌ Not implemented | ✅ Image gen, transcription, doc gen (4 tools) |
|
|
63
|
+
| **Web/Maps** | ❌ Not implemented | ✅ Search, weather, transit (5 tools) |
|
|
64
|
+
| **MCP Resources** | ✅ Structured data URIs | ❌ Not supported |
|
|
65
|
+
| **External MCP** | ❌ Pure server | ✅ Consumes external MCP servers |
|
|
66
|
+
| **Safety Model** | Client-controlled | Built-in safe/dangerous distinction |
|
|
67
|
+
| **Best For** | • Deep CRUD operations<br/>• External integrations<br/>• OAuth security<br/>• IDE/editor integration | • AI-driven actions in Nextcloud UI<br/>• Multi-service orchestration<br/>• User task automation<br/>• MCP aggregation hub |
|
|
68
|
+
|
|
69
|
+
See our [detailed comparison](docs/comparison-context-agent.md) for architecture diagrams, workflow examples, and guidance on when to use each approach.
|
|
70
|
+
|
|
71
|
+
Want to see another Nextcloud app supported? [Open an issue](https://github.com/cbcoutinho/nextcloud-mcp-server/issues) or contribute a pull request!
|
|
72
|
+
|
|
73
|
+
### Authentication
|
|
74
|
+
|
|
75
|
+
| Mode | Security | Best For |
|
|
76
|
+
|------|----------|----------|
|
|
77
|
+
| **OAuth2/OIDC** ⚠️ **Experimental** | 🔒 High | Testing, evaluation (requires patch for app-specific APIs) |
|
|
78
|
+
| **Basic Auth** ✅ | Lower | Development, testing, production |
|
|
79
|
+
|
|
80
|
+
> [!IMPORTANT]
|
|
81
|
+
> **OAuth is experimental** and requires a manual patch to the `user_oidc` app for full functionality:
|
|
82
|
+
> - **Required patch**: `user_oidc` app needs modifications for Bearer token support ([issue #1221](https://github.com/nextcloud/user_oidc/issues/1221))
|
|
83
|
+
> - **Impact**: Without the patch, most app-specific APIs (Notes, Calendar, Contacts, Deck, etc.) will fail with 401 errors
|
|
84
|
+
> - **What works without patches**: OAuth flow, PKCE support (with `oidc` v1.10.0+), OCS APIs
|
|
85
|
+
> - **Production use**: Wait for upstream patch to be merged into official releases
|
|
86
|
+
>
|
|
87
|
+
> See [OAuth Upstream Status](docs/oauth-upstream-status.md) for detailed information on required patches and workarounds.
|
|
88
|
+
|
|
89
|
+
OAuth2/OIDC provides secure, per-user authentication with access tokens. See [Authentication Guide](docs/authentication.md) for details.
|
|
90
|
+
|
|
91
|
+
## Quick Start
|
|
92
|
+
|
|
93
|
+
### 1. Install
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Clone the repository
|
|
97
|
+
git clone https://github.com/cbcoutinho/nextcloud-mcp-server.git
|
|
98
|
+
cd nextcloud-mcp-server
|
|
99
|
+
|
|
100
|
+
# Install with uv (recommended)
|
|
101
|
+
uv sync
|
|
102
|
+
|
|
103
|
+
# Or using Docker
|
|
104
|
+
docker pull ghcr.io/cbcoutinho/nextcloud-mcp-server:latest
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
See [Installation Guide](docs/installation.md) for detailed instructions.
|
|
108
|
+
|
|
109
|
+
### 2. Configure
|
|
110
|
+
|
|
111
|
+
Create a `.env` file:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Copy the sample
|
|
115
|
+
cp env.sample .env
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**For Basic Auth (recommended for most users):**
|
|
119
|
+
```dotenv
|
|
120
|
+
NEXTCLOUD_HOST=https://your.nextcloud.instance.com
|
|
121
|
+
NEXTCLOUD_USERNAME=your_username
|
|
122
|
+
NEXTCLOUD_PASSWORD=your_app_password
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**For OAuth (experimental - requires patches):**
|
|
126
|
+
```dotenv
|
|
127
|
+
NEXTCLOUD_HOST=https://your.nextcloud.instance.com
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
See [Configuration Guide](docs/configuration.md) for all options.
|
|
131
|
+
|
|
132
|
+
### 3. Set Up Authentication
|
|
133
|
+
|
|
134
|
+
**Basic Auth Setup (recommended):**
|
|
135
|
+
1. Create an app password in Nextcloud (Settings → Security → Devices & sessions)
|
|
136
|
+
2. Add credentials to `.env` file
|
|
137
|
+
3. Start the server
|
|
138
|
+
|
|
139
|
+
**OAuth Setup (experimental):**
|
|
140
|
+
1. Install Nextcloud OIDC apps (`oidc` v1.10.0+ + `user_oidc`)
|
|
141
|
+
2. **Apply required patch** to `user_oidc` app for Bearer token support (see [OAuth Upstream Status](docs/oauth-upstream-status.md))
|
|
142
|
+
3. Enable dynamic client registration or create an OIDC client with id & secret
|
|
143
|
+
4. Configure Bearer token validation in `user_oidc`
|
|
144
|
+
5. Start the server
|
|
145
|
+
|
|
146
|
+
See [OAuth Quick Start](docs/quickstart-oauth.md) for 5-minute setup or [OAuth Setup Guide](docs/oauth-setup.md) for detailed instructions.
|
|
147
|
+
|
|
148
|
+
### 4. Run the Server
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Load environment variables
|
|
152
|
+
export $(grep -v '^#' .env | xargs)
|
|
153
|
+
|
|
154
|
+
# Start with Basic Auth (default)
|
|
155
|
+
uv run nextcloud-mcp-server
|
|
156
|
+
|
|
157
|
+
# Or start with OAuth (experimental - requires patches)
|
|
158
|
+
uv run nextcloud-mcp-server --oauth
|
|
159
|
+
|
|
160
|
+
# Or with Docker
|
|
161
|
+
docker run -p 127.0.0.1:8000:8000 --env-file .env --rm \
|
|
162
|
+
ghcr.io/cbcoutinho/nextcloud-mcp-server:latest
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The server starts on `http://127.0.0.1:8000` by default.
|
|
166
|
+
|
|
167
|
+
See [Running the Server](docs/running.md) for more options.
|
|
168
|
+
|
|
169
|
+
### 5. Connect an MCP Client
|
|
170
|
+
|
|
171
|
+
Test with MCP Inspector:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
uv run mcp dev
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Or connect from:
|
|
178
|
+
- Claude Desktop
|
|
179
|
+
- Any MCP-compatible client
|
|
180
|
+
|
|
181
|
+
## Documentation
|
|
182
|
+
|
|
183
|
+
### Getting Started
|
|
184
|
+
- **[Installation](docs/installation.md)** - Install the server
|
|
185
|
+
- **[Configuration](docs/configuration.md)** - Environment variables and settings
|
|
186
|
+
- **[Authentication](docs/authentication.md)** - OAuth vs BasicAuth
|
|
187
|
+
- **[Running the Server](docs/running.md)** - Start and manage the server
|
|
188
|
+
|
|
189
|
+
### Architecture
|
|
190
|
+
- **[Comparison with Context Agent](docs/comparison-context-agent.md)** - How this MCP server differs from Nextcloud's Context Agent
|
|
191
|
+
|
|
192
|
+
### OAuth Documentation (Experimental)
|
|
193
|
+
- **[OAuth Quick Start](docs/quickstart-oauth.md)** - 5-minute setup guide
|
|
194
|
+
- **[OAuth Setup Guide](docs/oauth-setup.md)** - Detailed setup instructions
|
|
195
|
+
- **[OAuth Architecture](docs/oauth-architecture.md)** - How OAuth works
|
|
196
|
+
- **[OAuth Troubleshooting](docs/oauth-troubleshooting.md)** - OAuth-specific issues
|
|
197
|
+
- **[Upstream Status](docs/oauth-upstream-status.md)** - **Required patches and PRs** ⚠️
|
|
198
|
+
|
|
199
|
+
### Reference
|
|
200
|
+
- **[Troubleshooting](docs/troubleshooting.md)** - Common issues and solutions
|
|
201
|
+
|
|
202
|
+
### App-Specific Documentation
|
|
203
|
+
- [Notes API](docs/notes.md)
|
|
204
|
+
- [Calendar (CalDAV)](docs/calendar.md)
|
|
205
|
+
- [Contacts (CardDAV)](docs/contacts.md)
|
|
206
|
+
- [Cookbook](docs/cookbook.md)
|
|
207
|
+
- [Deck](docs/deck.md)
|
|
208
|
+
- [Tables](docs/table.md)
|
|
209
|
+
- [WebDAV](docs/webdav.md)
|
|
210
|
+
|
|
211
|
+
## MCP Tools & Resources
|
|
212
|
+
|
|
213
|
+
The server exposes Nextcloud functionality through MCP tools (for actions) and resources (for data browsing).
|
|
214
|
+
|
|
215
|
+
### Tools
|
|
216
|
+
Tools enable AI assistants to perform actions:
|
|
217
|
+
- `nc_notes_create_note` - Create a new note
|
|
218
|
+
- `nc_cookbook_import_recipe` - Import recipes from URLs with schema.org metadata
|
|
219
|
+
- `deck_create_card` - Create a Deck card
|
|
220
|
+
- `nc_calendar_create_event` - Create a calendar event
|
|
221
|
+
- `nc_contacts_create_contact` - Create a contact
|
|
222
|
+
- And many more...
|
|
223
|
+
|
|
224
|
+
### Resources
|
|
225
|
+
Resources provide read-only access to Nextcloud data:
|
|
226
|
+
- `nc://capabilities` - Server capabilities
|
|
227
|
+
- `cookbook://version` - Cookbook app version info
|
|
228
|
+
- `nc://Deck/boards/{board_id}` - Deck board data
|
|
229
|
+
- `notes://settings` - Notes app settings
|
|
230
|
+
- And more...
|
|
231
|
+
|
|
232
|
+
Run `uv run nextcloud-mcp-server --help` to see all available options.
|
|
233
|
+
|
|
234
|
+
## Examples
|
|
235
|
+
|
|
236
|
+
### Create a Note
|
|
237
|
+
```
|
|
238
|
+
AI: "Create a note called 'Meeting Notes' with today's agenda"
|
|
239
|
+
→ Uses nc_notes_create_note tool
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Manage Recipes
|
|
243
|
+
```
|
|
244
|
+
AI: "Import the recipe from this URL: https://www.example.com/recipe/chocolate-cake"
|
|
245
|
+
→ Uses nc_cookbook_import_recipe tool to extract schema.org metadata
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Manage Calendar
|
|
249
|
+
```
|
|
250
|
+
AI: "Schedule a team meeting for next Tuesday at 2pm"
|
|
251
|
+
→ Uses nc_calendar_create_event tool
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Organize Files
|
|
255
|
+
```
|
|
256
|
+
AI: "Create a folder called 'Project X' and move all PDFs there"
|
|
257
|
+
→ Uses WebDAV tools (nc_webdav_create_directory, nc_webdav_move)
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Project Management
|
|
261
|
+
```
|
|
262
|
+
AI: "Create a new Deck board for Q1 planning with Todo, In Progress, and Done stacks"
|
|
263
|
+
→ Uses deck_create_board and deck_create_stack tools
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## Transport Protocols
|
|
267
|
+
|
|
268
|
+
The server supports multiple MCP transport protocols:
|
|
269
|
+
|
|
270
|
+
- **streamable-http** (recommended) - Modern streaming protocol
|
|
271
|
+
- **sse** (default, deprecated) - Server-Sent Events for backward compatibility
|
|
272
|
+
- **http** - Standard HTTP protocol
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
# Use streamable-http (recommended)
|
|
276
|
+
uv run nextcloud-mcp-server --transport streamable-http
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
> [!WARNING]
|
|
280
|
+
> SSE transport is deprecated and will be removed in a future MCP specification version. Please migrate to `streamable-http`.
|
|
281
|
+
|
|
282
|
+
## Contributing
|
|
283
|
+
|
|
284
|
+
Contributions are welcome!
|
|
285
|
+
|
|
286
|
+
- Report bugs or request features: [GitHub Issues](https://github.com/cbcoutinho/nextcloud-mcp-server/issues)
|
|
287
|
+
- Submit improvements: [Pull Requests](https://github.com/cbcoutinho/nextcloud-mcp-server/pulls)
|
|
288
|
+
- Read [CLAUDE.md](CLAUDE.md) for development guidelines
|
|
289
|
+
|
|
290
|
+
## Security
|
|
291
|
+
|
|
292
|
+
[](https://mseep.ai/app/cbcoutinho-nextcloud-mcp-server)
|
|
293
|
+
|
|
294
|
+
This project takes security seriously:
|
|
295
|
+
- OAuth2/OIDC support (experimental - requires upstream patches)
|
|
296
|
+
- Basic Auth with app-specific passwords (recommended)
|
|
297
|
+
- No credential storage with OAuth mode
|
|
298
|
+
- Per-user access tokens
|
|
299
|
+
- Regular security assessments
|
|
300
|
+
|
|
301
|
+
Found a security issue? Please report it privately to the maintainers.
|
|
302
|
+
|
|
303
|
+
## License
|
|
304
|
+
|
|
305
|
+
This project is licensed under the AGPL-3.0 License. See [LICENSE](./LICENSE) for details.
|
|
306
|
+
|
|
307
|
+
## Star History
|
|
308
|
+
|
|
309
|
+
[](https://www.star-history.com/#cbcoutinho/nextcloud-mcp-server&Date)
|
|
310
|
+
|
|
311
|
+
## References
|
|
312
|
+
|
|
313
|
+
- [Model Context Protocol](https://github.com/modelcontextprotocol)
|
|
314
|
+
- [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk)
|
|
315
|
+
- [Nextcloud](https://nextcloud.com/)
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
# Nextcloud MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://github.com/cbcoutinho/nextcloud-mcp-server/pkgs/container/nextcloud-mcp-server)
|
|
4
|
+
|
|
5
|
+
**Enable AI assistants to interact with your Nextcloud instance.**
|
|
6
|
+
|
|
7
|
+
The Nextcloud MCP (Model Context Protocol) server allows Large Language Models like Claude, GPT, and Gemini to interact with your Nextcloud data through a secure API. Create notes, manage calendars, organize contacts, work with files, and more - all through natural language.
|
|
8
|
+
|
|
9
|
+
> [!NOTE]
|
|
10
|
+
> **Nextcloud has two ways to enable AI access:** Nextcloud provides [Context Agent](https://github.com/nextcloud/context_agent), an AI agent backend that powers the [Assistant](https://github.com/nextcloud/assistant) app and allows AI to interact with Nextcloud apps like Calendar, Talk, and Contacts. Context Agent runs as an ExApp inside Nextcloud and also exposes an MCP server endpoint for external LLMs. This project (Nextcloud MCP Server) is a **dedicated standalone MCP server** designed specifically for external MCP clients like Claude Code and IDEs, with deep CRUD operations and OAuth support.
|
|
11
|
+
|
|
12
|
+
### High-level Comparison: Nextcloud MCP Server vs. Nextcloud AI Stack
|
|
13
|
+
|
|
14
|
+
| Aspect | **Nextcloud MCP Server**<br/>(This Project) | **Nextcloud AI Stack**<br/>(Assistant + Context Agent) |
|
|
15
|
+
|--------|---------------------------------------------|--------------------------------------------------------|
|
|
16
|
+
| **Purpose** | External MCP client access to Nextcloud | AI assistance within Nextcloud UI |
|
|
17
|
+
| **Deployment** | Standalone (Docker, VM, K8s) | Inside Nextcloud (ExApp via AppAPI) |
|
|
18
|
+
| **Primary Users** | Claude Code, IDEs, external developers | Nextcloud end users via Assistant app |
|
|
19
|
+
| **Authentication** | OAuth2/OIDC or Basic Auth | Session-based (integrated) |
|
|
20
|
+
| **Notes Support** | ✅ Full CRUD + search (7 tools) | ❌ Not implemented |
|
|
21
|
+
| **Calendar** | ✅ Full CalDAV + tasks (20+ tools) | ✅ Events, free/busy, tasks (4 tools) |
|
|
22
|
+
| **Contacts** | ✅ Full CardDAV (8 tools) | ✅ Find person, current user (2 tools) |
|
|
23
|
+
| **Files (WebDAV)** | ✅ Full filesystem access (12 tools) | ✅ Read, folder tree, sharing (3 tools) |
|
|
24
|
+
| **Deck** | ✅ Full project management (15 tools) | ✅ Basic board/card ops (2 tools) |
|
|
25
|
+
| **Tables** | ✅ Row operations (5 tools) | ❌ Not implemented |
|
|
26
|
+
| **Cookbook** | ✅ Full recipe management (13 tools) | ❌ Not implemented |
|
|
27
|
+
| **Talk** | ❌ Not implemented | ✅ Messages, conversations (4 tools) |
|
|
28
|
+
| **Mail** | ❌ Not implemented | ✅ Send email (2 tools) |
|
|
29
|
+
| **AI Features** | ❌ Not implemented | ✅ Image gen, transcription, doc gen (4 tools) |
|
|
30
|
+
| **Web/Maps** | ❌ Not implemented | ✅ Search, weather, transit (5 tools) |
|
|
31
|
+
| **MCP Resources** | ✅ Structured data URIs | ❌ Not supported |
|
|
32
|
+
| **External MCP** | ❌ Pure server | ✅ Consumes external MCP servers |
|
|
33
|
+
| **Safety Model** | Client-controlled | Built-in safe/dangerous distinction |
|
|
34
|
+
| **Best For** | • Deep CRUD operations<br/>• External integrations<br/>• OAuth security<br/>• IDE/editor integration | • AI-driven actions in Nextcloud UI<br/>• Multi-service orchestration<br/>• User task automation<br/>• MCP aggregation hub |
|
|
35
|
+
|
|
36
|
+
See our [detailed comparison](docs/comparison-context-agent.md) for architecture diagrams, workflow examples, and guidance on when to use each approach.
|
|
37
|
+
|
|
38
|
+
Want to see another Nextcloud app supported? [Open an issue](https://github.com/cbcoutinho/nextcloud-mcp-server/issues) or contribute a pull request!
|
|
39
|
+
|
|
40
|
+
### Authentication
|
|
41
|
+
|
|
42
|
+
| Mode | Security | Best For |
|
|
43
|
+
|------|----------|----------|
|
|
44
|
+
| **OAuth2/OIDC** ⚠️ **Experimental** | 🔒 High | Testing, evaluation (requires patch for app-specific APIs) |
|
|
45
|
+
| **Basic Auth** ✅ | Lower | Development, testing, production |
|
|
46
|
+
|
|
47
|
+
> [!IMPORTANT]
|
|
48
|
+
> **OAuth is experimental** and requires a manual patch to the `user_oidc` app for full functionality:
|
|
49
|
+
> - **Required patch**: `user_oidc` app needs modifications for Bearer token support ([issue #1221](https://github.com/nextcloud/user_oidc/issues/1221))
|
|
50
|
+
> - **Impact**: Without the patch, most app-specific APIs (Notes, Calendar, Contacts, Deck, etc.) will fail with 401 errors
|
|
51
|
+
> - **What works without patches**: OAuth flow, PKCE support (with `oidc` v1.10.0+), OCS APIs
|
|
52
|
+
> - **Production use**: Wait for upstream patch to be merged into official releases
|
|
53
|
+
>
|
|
54
|
+
> See [OAuth Upstream Status](docs/oauth-upstream-status.md) for detailed information on required patches and workarounds.
|
|
55
|
+
|
|
56
|
+
OAuth2/OIDC provides secure, per-user authentication with access tokens. See [Authentication Guide](docs/authentication.md) for details.
|
|
57
|
+
|
|
58
|
+
## Quick Start
|
|
59
|
+
|
|
60
|
+
### 1. Install
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Clone the repository
|
|
64
|
+
git clone https://github.com/cbcoutinho/nextcloud-mcp-server.git
|
|
65
|
+
cd nextcloud-mcp-server
|
|
66
|
+
|
|
67
|
+
# Install with uv (recommended)
|
|
68
|
+
uv sync
|
|
69
|
+
|
|
70
|
+
# Or using Docker
|
|
71
|
+
docker pull ghcr.io/cbcoutinho/nextcloud-mcp-server:latest
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
See [Installation Guide](docs/installation.md) for detailed instructions.
|
|
75
|
+
|
|
76
|
+
### 2. Configure
|
|
77
|
+
|
|
78
|
+
Create a `.env` file:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Copy the sample
|
|
82
|
+
cp env.sample .env
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**For Basic Auth (recommended for most users):**
|
|
86
|
+
```dotenv
|
|
87
|
+
NEXTCLOUD_HOST=https://your.nextcloud.instance.com
|
|
88
|
+
NEXTCLOUD_USERNAME=your_username
|
|
89
|
+
NEXTCLOUD_PASSWORD=your_app_password
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**For OAuth (experimental - requires patches):**
|
|
93
|
+
```dotenv
|
|
94
|
+
NEXTCLOUD_HOST=https://your.nextcloud.instance.com
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
See [Configuration Guide](docs/configuration.md) for all options.
|
|
98
|
+
|
|
99
|
+
### 3. Set Up Authentication
|
|
100
|
+
|
|
101
|
+
**Basic Auth Setup (recommended):**
|
|
102
|
+
1. Create an app password in Nextcloud (Settings → Security → Devices & sessions)
|
|
103
|
+
2. Add credentials to `.env` file
|
|
104
|
+
3. Start the server
|
|
105
|
+
|
|
106
|
+
**OAuth Setup (experimental):**
|
|
107
|
+
1. Install Nextcloud OIDC apps (`oidc` v1.10.0+ + `user_oidc`)
|
|
108
|
+
2. **Apply required patch** to `user_oidc` app for Bearer token support (see [OAuth Upstream Status](docs/oauth-upstream-status.md))
|
|
109
|
+
3. Enable dynamic client registration or create an OIDC client with id & secret
|
|
110
|
+
4. Configure Bearer token validation in `user_oidc`
|
|
111
|
+
5. Start the server
|
|
112
|
+
|
|
113
|
+
See [OAuth Quick Start](docs/quickstart-oauth.md) for 5-minute setup or [OAuth Setup Guide](docs/oauth-setup.md) for detailed instructions.
|
|
114
|
+
|
|
115
|
+
### 4. Run the Server
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Load environment variables
|
|
119
|
+
export $(grep -v '^#' .env | xargs)
|
|
120
|
+
|
|
121
|
+
# Start with Basic Auth (default)
|
|
122
|
+
uv run nextcloud-mcp-server
|
|
123
|
+
|
|
124
|
+
# Or start with OAuth (experimental - requires patches)
|
|
125
|
+
uv run nextcloud-mcp-server --oauth
|
|
126
|
+
|
|
127
|
+
# Or with Docker
|
|
128
|
+
docker run -p 127.0.0.1:8000:8000 --env-file .env --rm \
|
|
129
|
+
ghcr.io/cbcoutinho/nextcloud-mcp-server:latest
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The server starts on `http://127.0.0.1:8000` by default.
|
|
133
|
+
|
|
134
|
+
See [Running the Server](docs/running.md) for more options.
|
|
135
|
+
|
|
136
|
+
### 5. Connect an MCP Client
|
|
137
|
+
|
|
138
|
+
Test with MCP Inspector:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
uv run mcp dev
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Or connect from:
|
|
145
|
+
- Claude Desktop
|
|
146
|
+
- Any MCP-compatible client
|
|
147
|
+
|
|
148
|
+
## Documentation
|
|
149
|
+
|
|
150
|
+
### Getting Started
|
|
151
|
+
- **[Installation](docs/installation.md)** - Install the server
|
|
152
|
+
- **[Configuration](docs/configuration.md)** - Environment variables and settings
|
|
153
|
+
- **[Authentication](docs/authentication.md)** - OAuth vs BasicAuth
|
|
154
|
+
- **[Running the Server](docs/running.md)** - Start and manage the server
|
|
155
|
+
|
|
156
|
+
### Architecture
|
|
157
|
+
- **[Comparison with Context Agent](docs/comparison-context-agent.md)** - How this MCP server differs from Nextcloud's Context Agent
|
|
158
|
+
|
|
159
|
+
### OAuth Documentation (Experimental)
|
|
160
|
+
- **[OAuth Quick Start](docs/quickstart-oauth.md)** - 5-minute setup guide
|
|
161
|
+
- **[OAuth Setup Guide](docs/oauth-setup.md)** - Detailed setup instructions
|
|
162
|
+
- **[OAuth Architecture](docs/oauth-architecture.md)** - How OAuth works
|
|
163
|
+
- **[OAuth Troubleshooting](docs/oauth-troubleshooting.md)** - OAuth-specific issues
|
|
164
|
+
- **[Upstream Status](docs/oauth-upstream-status.md)** - **Required patches and PRs** ⚠️
|
|
165
|
+
|
|
166
|
+
### Reference
|
|
167
|
+
- **[Troubleshooting](docs/troubleshooting.md)** - Common issues and solutions
|
|
168
|
+
|
|
169
|
+
### App-Specific Documentation
|
|
170
|
+
- [Notes API](docs/notes.md)
|
|
171
|
+
- [Calendar (CalDAV)](docs/calendar.md)
|
|
172
|
+
- [Contacts (CardDAV)](docs/contacts.md)
|
|
173
|
+
- [Cookbook](docs/cookbook.md)
|
|
174
|
+
- [Deck](docs/deck.md)
|
|
175
|
+
- [Tables](docs/table.md)
|
|
176
|
+
- [WebDAV](docs/webdav.md)
|
|
177
|
+
|
|
178
|
+
## MCP Tools & Resources
|
|
179
|
+
|
|
180
|
+
The server exposes Nextcloud functionality through MCP tools (for actions) and resources (for data browsing).
|
|
181
|
+
|
|
182
|
+
### Tools
|
|
183
|
+
Tools enable AI assistants to perform actions:
|
|
184
|
+
- `nc_notes_create_note` - Create a new note
|
|
185
|
+
- `nc_cookbook_import_recipe` - Import recipes from URLs with schema.org metadata
|
|
186
|
+
- `deck_create_card` - Create a Deck card
|
|
187
|
+
- `nc_calendar_create_event` - Create a calendar event
|
|
188
|
+
- `nc_contacts_create_contact` - Create a contact
|
|
189
|
+
- And many more...
|
|
190
|
+
|
|
191
|
+
### Resources
|
|
192
|
+
Resources provide read-only access to Nextcloud data:
|
|
193
|
+
- `nc://capabilities` - Server capabilities
|
|
194
|
+
- `cookbook://version` - Cookbook app version info
|
|
195
|
+
- `nc://Deck/boards/{board_id}` - Deck board data
|
|
196
|
+
- `notes://settings` - Notes app settings
|
|
197
|
+
- And more...
|
|
198
|
+
|
|
199
|
+
Run `uv run nextcloud-mcp-server --help` to see all available options.
|
|
200
|
+
|
|
201
|
+
## Examples
|
|
202
|
+
|
|
203
|
+
### Create a Note
|
|
204
|
+
```
|
|
205
|
+
AI: "Create a note called 'Meeting Notes' with today's agenda"
|
|
206
|
+
→ Uses nc_notes_create_note tool
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Manage Recipes
|
|
210
|
+
```
|
|
211
|
+
AI: "Import the recipe from this URL: https://www.example.com/recipe/chocolate-cake"
|
|
212
|
+
→ Uses nc_cookbook_import_recipe tool to extract schema.org metadata
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Manage Calendar
|
|
216
|
+
```
|
|
217
|
+
AI: "Schedule a team meeting for next Tuesday at 2pm"
|
|
218
|
+
→ Uses nc_calendar_create_event tool
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Organize Files
|
|
222
|
+
```
|
|
223
|
+
AI: "Create a folder called 'Project X' and move all PDFs there"
|
|
224
|
+
→ Uses WebDAV tools (nc_webdav_create_directory, nc_webdav_move)
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Project Management
|
|
228
|
+
```
|
|
229
|
+
AI: "Create a new Deck board for Q1 planning with Todo, In Progress, and Done stacks"
|
|
230
|
+
→ Uses deck_create_board and deck_create_stack tools
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Transport Protocols
|
|
234
|
+
|
|
235
|
+
The server supports multiple MCP transport protocols:
|
|
236
|
+
|
|
237
|
+
- **streamable-http** (recommended) - Modern streaming protocol
|
|
238
|
+
- **sse** (default, deprecated) - Server-Sent Events for backward compatibility
|
|
239
|
+
- **http** - Standard HTTP protocol
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# Use streamable-http (recommended)
|
|
243
|
+
uv run nextcloud-mcp-server --transport streamable-http
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
> [!WARNING]
|
|
247
|
+
> SSE transport is deprecated and will be removed in a future MCP specification version. Please migrate to `streamable-http`.
|
|
248
|
+
|
|
249
|
+
## Contributing
|
|
250
|
+
|
|
251
|
+
Contributions are welcome!
|
|
252
|
+
|
|
253
|
+
- Report bugs or request features: [GitHub Issues](https://github.com/cbcoutinho/nextcloud-mcp-server/issues)
|
|
254
|
+
- Submit improvements: [Pull Requests](https://github.com/cbcoutinho/nextcloud-mcp-server/pulls)
|
|
255
|
+
- Read [CLAUDE.md](CLAUDE.md) for development guidelines
|
|
256
|
+
|
|
257
|
+
## Security
|
|
258
|
+
|
|
259
|
+
[](https://mseep.ai/app/cbcoutinho-nextcloud-mcp-server)
|
|
260
|
+
|
|
261
|
+
This project takes security seriously:
|
|
262
|
+
- OAuth2/OIDC support (experimental - requires upstream patches)
|
|
263
|
+
- Basic Auth with app-specific passwords (recommended)
|
|
264
|
+
- No credential storage with OAuth mode
|
|
265
|
+
- Per-user access tokens
|
|
266
|
+
- Regular security assessments
|
|
267
|
+
|
|
268
|
+
Found a security issue? Please report it privately to the maintainers.
|
|
269
|
+
|
|
270
|
+
## License
|
|
271
|
+
|
|
272
|
+
This project is licensed under the AGPL-3.0 License. See [LICENSE](./LICENSE) for details.
|
|
273
|
+
|
|
274
|
+
## Star History
|
|
275
|
+
|
|
276
|
+
[](https://www.star-history.com/#cbcoutinho/nextcloud-mcp-server&Date)
|
|
277
|
+
|
|
278
|
+
## References
|
|
279
|
+
|
|
280
|
+
- [Model Context Protocol](https://github.com/modelcontextprotocol)
|
|
281
|
+
- [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk)
|
|
282
|
+
- [Nextcloud](https://nextcloud.com/)
|
|
File without changes
|