@mediagraph/mcp 1.0.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Mediagraph
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,173 @@
1
+ # Mediagraph MCP Server
2
+
3
+ An MCP (Model Context Protocol) server that provides AI assistants with access to the [Mediagraph](https://mediagraph.io) digital asset management platform.
4
+
5
+ ## Features
6
+
7
+ - **OAuth Authentication**: Secure authorization with PKCE support
8
+ - **Asset Management**: Search, view, and update digital assets
9
+ - **Organization Tools**: Work with collections, lightboxes, and folders
10
+ - **Tagging**: Add and manage asset tags
11
+ - **Sharing**: Create share links for assets and collections
12
+ - **Bulk Operations**: Perform batch updates on multiple assets
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install -g @mediagraph/mcp
18
+ ```
19
+
20
+ Or run directly with npx:
21
+
22
+ ```bash
23
+ npx @mediagraph/mcp
24
+ ```
25
+
26
+ ## Quick Start
27
+
28
+ ### 1. Get OAuth Credentials
29
+
30
+ 1. Log into your Mediagraph organization
31
+ 2. Go to **Settings > API & Integrations**
32
+ 3. Create a new OAuth application
33
+ 4. Copy the Client ID (and Client Secret if using a confidential client)
34
+
35
+ ### 2. Authorize
36
+
37
+ ```bash
38
+ MEDIAGRAPH_CLIENT_ID=your-client-id npx @mediagraph/mcp authorize
39
+ ```
40
+
41
+ This will open a browser window for you to authorize the MCP server with your Mediagraph account.
42
+
43
+ ### 3. Configure Claude Desktop
44
+
45
+ Add the following to your Claude Desktop configuration file:
46
+
47
+ **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
48
+ **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
49
+
50
+ ```json
51
+ {
52
+ "mcpServers": {
53
+ "mediagraph": {
54
+ "command": "npx",
55
+ "args": ["@mediagraph/mcp"],
56
+ "env": {
57
+ "MEDIAGRAPH_CLIENT_ID": "your-client-id"
58
+ }
59
+ }
60
+ }
61
+ }
62
+ ```
63
+
64
+ ### 4. Start Using
65
+
66
+ Restart Claude Desktop and you can now ask Claude to:
67
+
68
+ - "Search for images tagged 'sunset'"
69
+ - "Show me the details of asset ABC123"
70
+ - "Add tags 'nature' and 'landscape' to this asset"
71
+ - "Create a new collection called 'Project Photos'"
72
+ - "Find all videos uploaded this week"
73
+
74
+ ## Available Tools
75
+
76
+ | Tool | Description |
77
+ |------|-------------|
78
+ | `whoami` | Get current user and organization info |
79
+ | `search_assets` | Search assets with filters (tags, dates, ratings, etc.) |
80
+ | `get_asset` | Get detailed asset information |
81
+ | `update_asset` | Update asset metadata (title, description, etc.) |
82
+ | `add_tags` | Add tags to an asset |
83
+ | `download_asset` | Get a download URL for an asset |
84
+ | `list_collections` | List all collections |
85
+ | `get_collection` | Get collection details |
86
+ | `create_collection` | Create a new collection |
87
+ | `add_to_collection` | Add an asset to a collection |
88
+ | `list_lightboxes` | List all lightboxes |
89
+ | `get_lightbox` | Get lightbox details |
90
+ | `create_lightbox` | Create a new lightbox |
91
+ | `add_to_lightbox` | Add an asset to a lightbox |
92
+ | `list_storage_folders` | List storage folders |
93
+ | `list_tags` | List available tags |
94
+ | `create_share_link` | Create a share link |
95
+ | `bulk_update` | Bulk operations on multiple assets |
96
+
97
+ ## Available Resources
98
+
99
+ The server provides MCP resources for direct access to Mediagraph data:
100
+
101
+ - `mediagraph://asset/{id}` - Asset details
102
+ - `mediagraph://collection/{id}` - Collection with assets
103
+ - `mediagraph://lightbox/{id}` - Lightbox with assets
104
+ - `mediagraph://search?q={query}` - Search results
105
+
106
+ ## CLI Commands
107
+
108
+ ```bash
109
+ # Authorize with Mediagraph
110
+ npx @mediagraph/mcp authorize
111
+
112
+ # Check authentication status
113
+ npx @mediagraph/mcp status
114
+
115
+ # Log out and revoke tokens
116
+ npx @mediagraph/mcp logout
117
+
118
+ # Show help
119
+ npx @mediagraph/mcp help
120
+ ```
121
+
122
+ ## Environment Variables
123
+
124
+ | Variable | Required | Default | Description |
125
+ |----------|----------|---------|-------------|
126
+ | `MEDIAGRAPH_CLIENT_ID` | Yes | - | OAuth client ID |
127
+ | `MEDIAGRAPH_CLIENT_SECRET` | No | - | OAuth client secret (for confidential clients) |
128
+ | `MEDIAGRAPH_API_URL` | No | `https://api.mediagraph.io` | API base URL |
129
+ | `MEDIAGRAPH_OAUTH_URL` | No | `https://mediagraph.io` | OAuth server URL |
130
+ | `MEDIAGRAPH_REDIRECT_PORT` | No | `52584` | Local callback port for OAuth |
131
+
132
+ ## Security
133
+
134
+ - Tokens are stored encrypted in `~/.mediagraph/tokens.enc`
135
+ - PKCE is used for OAuth to prevent authorization code interception
136
+ - Access tokens are automatically refreshed before expiration
137
+ - No sensitive data is logged or exposed
138
+
139
+ ## Development
140
+
141
+ ```bash
142
+ # Clone the repository
143
+ git clone https://github.com/mediagraph/mediagraph-mcp.git
144
+ cd mediagraph-mcp
145
+
146
+ # Install dependencies
147
+ npm install
148
+
149
+ # Build
150
+ npm run build
151
+
152
+ # Run in development mode
153
+ npm run dev
154
+ ```
155
+
156
+ ## Testing with MCP Inspector
157
+
158
+ ```bash
159
+ # Build the project
160
+ npm run build
161
+
162
+ # Run with inspector
163
+ npx @modelcontextprotocol/inspector node dist/index.js
164
+ ```
165
+
166
+ ## License
167
+
168
+ MIT License - see [LICENSE](LICENSE) for details.
169
+
170
+ ## Support
171
+
172
+ - [API Documentation](https://docs.mediagraph.io)
173
+ - [GitHub Issues](https://github.com/mediagraph/mediagraph-mcp/issues)
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node