universal-mcp 0.1.15rc7__py3-none-any.whl → 0.1.16__py3-none-any.whl
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.
- universal_mcp/applications/__init__.py +20 -27
- universal_mcp/applications/application.py +19 -55
- universal_mcp/cli.py +10 -29
- universal_mcp/config.py +16 -48
- universal_mcp/integrations/__init__.py +1 -3
- universal_mcp/logger.py +31 -29
- universal_mcp/servers/server.py +6 -18
- universal_mcp/tools/func_metadata.py +5 -19
- universal_mcp/tools/manager.py +5 -15
- universal_mcp/tools/tools.py +4 -11
- universal_mcp/utils/agentr.py +2 -6
- universal_mcp/utils/common.py +1 -1
- universal_mcp/utils/docstring_parser.py +4 -13
- universal_mcp/utils/installation.py +67 -184
- universal_mcp/utils/openapi/api_generator.py +1 -3
- universal_mcp/utils/openapi/docgen.py +17 -54
- universal_mcp/utils/openapi/openapi.py +62 -110
- universal_mcp/utils/openapi/preprocessor.py +60 -190
- universal_mcp/utils/openapi/readme.py +3 -9
- universal_mcp-0.1.16.dist-info/METADATA +282 -0
- universal_mcp-0.1.16.dist-info/RECORD +44 -0
- universal_mcp-0.1.15rc7.dist-info/METADATA +0 -247
- universal_mcp-0.1.15rc7.dist-info/RECORD +0 -44
- {universal_mcp-0.1.15rc7.dist-info → universal_mcp-0.1.16.dist-info}/WHEEL +0 -0
- {universal_mcp-0.1.15rc7.dist-info → universal_mcp-0.1.16.dist-info}/entry_points.txt +0 -0
- {universal_mcp-0.1.15rc7.dist-info → universal_mcp-0.1.16.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,282 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: universal-mcp
|
3
|
+
Version: 0.1.16
|
4
|
+
Summary: Universal MCP acts as a middle ware for your API applications. It can store your credentials, authorize, enable disable apps on the fly and much more.
|
5
|
+
Author-email: Manoj Bajaj <manojbajaj95@gmail.com>
|
6
|
+
License: MIT
|
7
|
+
License-File: LICENSE
|
8
|
+
Requires-Python: >=3.11
|
9
|
+
Requires-Dist: cookiecutter>=2.6.0
|
10
|
+
Requires-Dist: gql[all]>=3.5.2
|
11
|
+
Requires-Dist: jinja2>=3.1.3
|
12
|
+
Requires-Dist: jsonref>=1.1.0
|
13
|
+
Requires-Dist: keyring>=25.6.0
|
14
|
+
Requires-Dist: langchain-mcp-adapters>=0.0.3
|
15
|
+
Requires-Dist: litellm>=1.30.7
|
16
|
+
Requires-Dist: loguru>=0.7.3
|
17
|
+
Requires-Dist: mcp>=1.7.1
|
18
|
+
Requires-Dist: posthog>=3.24.0
|
19
|
+
Requires-Dist: pydantic-settings>=2.8.1
|
20
|
+
Requires-Dist: pydantic>=2.11.1
|
21
|
+
Requires-Dist: pyyaml>=6.0.2
|
22
|
+
Requires-Dist: rich>=14.0.0
|
23
|
+
Requires-Dist: typer>=0.15.2
|
24
|
+
Provides-Extra: dev
|
25
|
+
Requires-Dist: litellm>=1.30.7; extra == 'dev'
|
26
|
+
Requires-Dist: pre-commit>=4.2.0; extra == 'dev'
|
27
|
+
Requires-Dist: pyright>=1.1.398; extra == 'dev'
|
28
|
+
Requires-Dist: pytest-asyncio>=0.26.0; extra == 'dev'
|
29
|
+
Requires-Dist: pytest>=8.3.5; extra == 'dev'
|
30
|
+
Requires-Dist: ruff>=0.11.4; extra == 'dev'
|
31
|
+
Provides-Extra: playground
|
32
|
+
Requires-Dist: langchain-openai>=0.3.12; extra == 'playground'
|
33
|
+
Requires-Dist: langgraph-checkpoint-sqlite>=2.0.6; extra == 'playground'
|
34
|
+
Requires-Dist: langgraph>=0.3.24; extra == 'playground'
|
35
|
+
Requires-Dist: litellm>=1.30.7; extra == 'playground'
|
36
|
+
Requires-Dist: python-dotenv>=1.0.1; extra == 'playground'
|
37
|
+
Requires-Dist: streamlit>=1.44.1; extra == 'playground'
|
38
|
+
Requires-Dist: watchdog>=6.0.0; extra == 'playground'
|
39
|
+
Description-Content-Type: text/markdown
|
40
|
+
|
41
|
+
# Universal MCP
|
42
|
+
|
43
|
+
Universal MCP acts as a middleware layer for your API applications, enabling seamless integration with various services through the Model Control Protocol (MCP). It simplifies credential management, authorization, dynamic app enablement, and provides a robust framework for building and managing AI-powered tools.
|
44
|
+
|
45
|
+
## 🌟 Features
|
46
|
+
|
47
|
+
- **MCP (Model Control Protocol) Integration**: Seamlessly works with MCP server architecture for standardized agent-tool communication.
|
48
|
+
- **Simplified API Integration**: Connect to services like GitHub, Google Calendar, Gmail, Reddit, Tavily, and more with minimal code. See [AgentR](https://agentr.dev) for a list of available applications.
|
49
|
+
- **Managed Authentication**: Built-in support for API keys and OAuth-based authentication flows, often managed via the AgentR platform.
|
50
|
+
- **Extensible Architecture**: Easily build and add new app integrations with minimal boilerplate using provided base classes and generation tools.
|
51
|
+
- **Credential Management**: Flexible and secure storage options for API credentials (memory, environment variables, system keyring).
|
52
|
+
- **Comprehensive Tool Management**: Robust tool registration, Pydantic-based validation, automatic docstring parsing, and execution capabilities. Supports conversion between MCP, LangChain, and OpenAI tool formats.
|
53
|
+
- **Multiple Server Types**: Configurations for local development, AgentR-connected dynamic app loading, and single-application servers.
|
54
|
+
- **Playground Environment**: Includes an interactive Streamlit-based playground for testing agents and tools.
|
55
|
+
|
56
|
+
## 🔧 Installation
|
57
|
+
|
58
|
+
Install Universal MCP using pip:
|
59
|
+
|
60
|
+
```bash
|
61
|
+
pip install universal-mcp
|
62
|
+
```
|
63
|
+
|
64
|
+
## 🚀 Quick Start
|
65
|
+
|
66
|
+
**Important Prerequisite: AgentR API Key (If Using AgentR Integration)**
|
67
|
+
|
68
|
+
If you plan to use integrations with `type: "agentr"` (for services like GitHub, Gmail, Notion via the AgentR platform), or if you run the MCP server itself with `type: "agentr"`, you first need an AgentR API key:
|
69
|
+
|
70
|
+
1. Visit [https://agentr.dev](https://agentr.dev) to create an account and generate an API key from your dashboard.
|
71
|
+
2. Set it as an environment variable _before_ running the MCP server:
|
72
|
+
```bash
|
73
|
+
export AGENTR_API_KEY="your_api_key_here"
|
74
|
+
```
|
75
|
+
|
76
|
+
**1. Create a Configuration File (e.g., `config.json`)**
|
77
|
+
|
78
|
+
This file defines the server settings, credential stores, and the applications to load with their respective integrations.
|
79
|
+
|
80
|
+
```json
|
81
|
+
{
|
82
|
+
"name": "My Local MCP Server",
|
83
|
+
"description": "A server for testing applications locally",
|
84
|
+
"type": "local", // "local" or "agentr"
|
85
|
+
"transport": "sse", // "sse", "stdio", or "http"
|
86
|
+
"port": 8005, // Relevant for "sse" or "http"
|
87
|
+
"store": {
|
88
|
+
// Default store for integrations
|
89
|
+
"name": "my_mcp_store",
|
90
|
+
"type": "keyring" // "keyring", "environment", or "memory"
|
91
|
+
},
|
92
|
+
"apps": [
|
93
|
+
{
|
94
|
+
"name": "zenquotes", // App slug (e.g., from agentr.dev)
|
95
|
+
"integration": null // No authentication needed for this app
|
96
|
+
},
|
97
|
+
{
|
98
|
+
"name": "tavily",
|
99
|
+
"integration": {
|
100
|
+
"name": "TAVILY_API_KEY", // Unique name for this credential if type is "api_key"
|
101
|
+
"type": "api_key",
|
102
|
+
"store": {
|
103
|
+
// Override default store for this specific app
|
104
|
+
"type": "environment" // Looks for TAVILY_API_KEY env var
|
105
|
+
}
|
106
|
+
}
|
107
|
+
},
|
108
|
+
{
|
109
|
+
"name": "github",
|
110
|
+
"integration": {
|
111
|
+
"name": "github", // Matches the service name in AgentR
|
112
|
+
"type": "agentr" // Uses AgentR platform for auth/creds
|
113
|
+
}
|
114
|
+
}
|
115
|
+
]
|
116
|
+
}
|
117
|
+
```
|
118
|
+
|
119
|
+
_Notes on `config.json`:_
|
120
|
+
|
121
|
+
- `type: "local"`: Runs applications defined directly in the config's `apps` list.
|
122
|
+
- `type: "agentr"`: Connects to the AgentR platform to dynamically load user-enabled apps (ignores the `apps` list in the config) and handle credentials. Requires `AGENTR_API_KEY` environment variable.
|
123
|
+
- `store`: Defines credential storage.
|
124
|
+
- `environment`: Looks for an environment variable named `<INTEGRATION_NAME_UPPERCASE>` (e.g., `TAVILY_API_KEY` for the example above).
|
125
|
+
- `keyring`: Uses the system's secure credential storage.
|
126
|
+
- `memory`: Transient storage, lost when the server stops.
|
127
|
+
- `integration`: Configures authentication for each app.
|
128
|
+
- `type: "agentr"`: Uses the AgentR platform for OAuth/credential management.
|
129
|
+
- `type: "api_key"`: Uses the specified `store` to retrieve the key.
|
130
|
+
|
131
|
+
**2. Run the Server via CLI**
|
132
|
+
|
133
|
+
Ensure any required environment variables (like `TAVILY_API_KEY` for the Tavily example, or `AGENTR_API_KEY` if using `"agentr"` type server/integrations) are set.
|
134
|
+
|
135
|
+
```bash
|
136
|
+
universal_mcp run -c config.json
|
137
|
+
```
|
138
|
+
|
139
|
+
The server will start, load the configured applications (or connect to AgentR if `type: "agentr"`), and listen for connections based on the `transport` type.
|
140
|
+
|
141
|
+
## 🛠️ Using the Playground
|
142
|
+
|
143
|
+
The `playground` directory provides a runnable Streamlit application for interacting with agents that can use tools from an MCP server.
|
144
|
+
|
145
|
+
**Prerequisites:**
|
146
|
+
|
147
|
+
- **`local_config.json`**: This file must exist in the **project root directory** (the same directory as this `README.md`). It configures the _local_ MCP server that the playground's agent can connect to if you choose to run one. For an example, see the `local_config.json` structure in the [Playground README](playground/README.md).
|
148
|
+
- **Dependencies**: Install playground-specific dependencies. If you have the project cloned, you might install them via:
|
149
|
+
```bash
|
150
|
+
pip install -e .[playground]
|
151
|
+
# or manually install fastapi, streamlit, uvicorn, langchain-openai, etc.
|
152
|
+
```
|
153
|
+
|
154
|
+
**Running the Playground:**
|
155
|
+
|
156
|
+
The easiest way is to use the automated startup script from the **project root directory**:
|
157
|
+
|
158
|
+
```bash
|
159
|
+
python playground
|
160
|
+
```
|
161
|
+
|
162
|
+
This script will:
|
163
|
+
|
164
|
+
1. Optionally start a local MCP server (based on your `local_config.json`) if you confirm.
|
165
|
+
2. Launch the Streamlit application.
|
166
|
+
|
167
|
+
For more detailed setup, manual startup instructions, and an explanation of the `local_config.json` for the playground, please refer to the [Playground README](playground/README.md).
|
168
|
+
|
169
|
+
## 🧩 Available Applications
|
170
|
+
|
171
|
+
Universal MCP can integrate with a wide variety of applications. For a list of publicly available applications and their slugs (e.g., "github", "google-calendar"), please visit [AgentR Applications](https://agentr.dev).
|
172
|
+
Applications are typically installed dynamically by Universal MCP from their respective repositories when first referenced by slug.
|
173
|
+
|
174
|
+
_Authentication Type Notes:_
|
175
|
+
|
176
|
+
- _OAuth (via AgentR)_: Usually requires configuring the app's integration with `type: "agentr"` in your `ServerConfig`. This leverages the AgentR platform for the OAuth flow and requires the `AGENTR_API_KEY` to be set.
|
177
|
+
- _API Key (via Integration)_: Requires configuring `type: "api_key"` for the app's integration in your `ServerConfig`, along with a `store` (like `environment` or `keyring`) to specify where the API key is located.
|
178
|
+
|
179
|
+
## 🔐 Integration Types
|
180
|
+
|
181
|
+
Universal MCP supports different ways to handle authentication for applications:
|
182
|
+
|
183
|
+
### 1. API Key Integration (`type: "api_key"`)
|
184
|
+
|
185
|
+
For services that authenticate via simple API keys.
|
186
|
+
|
187
|
+
```json
|
188
|
+
// In your ServerConfig apps array:
|
189
|
+
{
|
190
|
+
"name": "tavily",
|
191
|
+
"integration": {
|
192
|
+
"name": "TAVILY_API_KEY", // Used by the store (e.g., as env var name)
|
193
|
+
"type": "api_key",
|
194
|
+
"store": {
|
195
|
+
"type": "environment" // Or "keyring", "memory"
|
196
|
+
}
|
197
|
+
}
|
198
|
+
}
|
199
|
+
```
|
200
|
+
|
201
|
+
### 2. AgentR Integration (`type: "agentr"`)
|
202
|
+
|
203
|
+
Recommended for services integrated with the AgentR platform, which typically handles OAuth flows or centrally managed credentials. Requires the `AGENTR_API_KEY` environment variable to be set for the MCP server process.
|
204
|
+
|
205
|
+
```json
|
206
|
+
// In your ServerConfig apps array:
|
207
|
+
{
|
208
|
+
"name": "github",
|
209
|
+
"integration": {
|
210
|
+
"name": "github", // Matches the service name configured in AgentR
|
211
|
+
"type": "agentr"
|
212
|
+
}
|
213
|
+
}
|
214
|
+
```
|
215
|
+
|
216
|
+
When an action requiring authorization is called, the `AgentRIntegration` will prompt the user (via the MCP client) to visit a URL to complete the OAuth flow managed by AgentR. This is also the default integration type for apps if the main server config is `type: "agentr"`.
|
217
|
+
|
218
|
+
### 3. Direct OAuth Integration (`type: "oauth"`)
|
219
|
+
|
220
|
+
While `AgentRIntegration` is generally preferred for OAuth, a direct `OAuthIntegration` class exists. However, it requires manual configuration of client IDs, secrets, and callback handling, which is more complex to set up outside the AgentR platform.
|
221
|
+
|
222
|
+
## 🤖 CLI Usage
|
223
|
+
|
224
|
+
Universal MCP includes a powerful command-line interface:
|
225
|
+
|
226
|
+
```bash
|
227
|
+
# Run the MCP server using a configuration file
|
228
|
+
universal_mcp run -c config.json
|
229
|
+
|
230
|
+
# Initialize a new MCP application project structure
|
231
|
+
universal_mcp init --app-name my-cool-app --o ./my-apps --integration-type api_key
|
232
|
+
|
233
|
+
# Generate API client code and application structure from an OpenAPI schema
|
234
|
+
universal_mcp generate -s <path_to_schema.json_or_yaml> -o <path/to/app_output_directory> --c CustomAppClassName
|
235
|
+
# Example: universal_mcp generate -s notion_api.yaml -o ./custom_apps/notion --c MyNotionApp
|
236
|
+
|
237
|
+
# Preprocess an OpenAPI schema using an LLM to fill/enhance descriptions
|
238
|
+
universal_mcp preprocess -s <path_to_input_schema.json_or_yaml> -o <path_to_processed_schema.json_or_yaml>
|
239
|
+
|
240
|
+
# Generate Google-style docstrings for functions in a Python file using an LLM
|
241
|
+
universal_mcp docgen <path/to/app_file.py>
|
242
|
+
|
243
|
+
# Generate a README.md for a generated application file
|
244
|
+
universal_mcp readme <path/to/app_file.py>
|
245
|
+
|
246
|
+
# Install MCP configuration for supported desktop apps (e.g., Claude, Cursor)
|
247
|
+
# Requires an AgentR API key for configuration.
|
248
|
+
universal_mcp install claude
|
249
|
+
universal_mcp install cursor
|
250
|
+
|
251
|
+
# Check installed version (standard typer command)
|
252
|
+
universal_mcp --version
|
253
|
+
```
|
254
|
+
|
255
|
+
## 📋 Requirements
|
256
|
+
|
257
|
+
- Python 3.10+
|
258
|
+
- Key Dependencies (installed automatically via pip, see `pyproject.toml` for full list):
|
259
|
+
- `mcp-server`
|
260
|
+
- `loguru`
|
261
|
+
- `typer`
|
262
|
+
- `httpx`
|
263
|
+
- `pydantic`
|
264
|
+
- `pyyaml`
|
265
|
+
- `keyring` (for `KeyringStore`)
|
266
|
+
- `litellm` (for `docgen` and `preprocess` commands)
|
267
|
+
- `uv` (used internally for dynamic package installation)
|
268
|
+
|
269
|
+
## 📚 Documentation
|
270
|
+
|
271
|
+
For more detailed information about specific components:
|
272
|
+
|
273
|
+
- [Applications Framework](src/universal_mcp/applications/README.md)
|
274
|
+
- [Tool Management](src/universal_mcp/tools/README.md)
|
275
|
+
- [Server Implementations](src/universal_mcp/servers/README.md)
|
276
|
+
- [Credential Stores](src/universal_mcp/stores/README.md)
|
277
|
+
- [Integration & Authentication](src/universal_mcp/integrations/README.md)
|
278
|
+
- [Playground Usage](playground/README.md)
|
279
|
+
|
280
|
+
## 📝 License
|
281
|
+
|
282
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
@@ -0,0 +1,44 @@
|
|
1
|
+
universal_mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
universal_mcp/analytics.py,sha256=Dkv8mkc_2T2t5NxLSZzcr3BlmOispj1RKtbB86V1i4M,2306
|
3
|
+
universal_mcp/cli.py,sha256=MkWxF2uawR-6rHX5TepPavgXgWVedg5LmL0ioz16nUI,8399
|
4
|
+
universal_mcp/config.py,sha256=UgonQUVQ_qRXWGmfSr1s9gDBpxcgTY3ZQyo1g4B47-o,3477
|
5
|
+
universal_mcp/exceptions.py,sha256=2A_aIzcwjB99tR4xCFjPkWPf10rBK_785FerJI7Tzns,564
|
6
|
+
universal_mcp/logger.py,sha256=VmH_83efpErLEDTJqz55Dp0dioTXfGvMBLZUx5smOLc,2116
|
7
|
+
universal_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
+
universal_mcp/applications/README.md,sha256=eqbizxaTxKH2O1tyIJR2yI0Db5TQxtgPd_vbpWyCa2Y,3527
|
9
|
+
universal_mcp/applications/__init__.py,sha256=yDLrQhICcvoSf8KTLkKOdqcG1N7c4UOYL3tNIjAo2kk,3182
|
10
|
+
universal_mcp/applications/application.py,sha256=3P7dpdOukaXnubjQi8jV_NZYESpW8QWYLF6QdcxzxzA,13771
|
11
|
+
universal_mcp/integrations/README.md,sha256=lTAPXO2nivcBe1q7JT6PRa6v9Ns_ZersQMIdw-nmwEA,996
|
12
|
+
universal_mcp/integrations/__init__.py,sha256=zEHYH_1FBsWvHssOMkaElQXG5UydciZfoTS49Q_Um6E,916
|
13
|
+
universal_mcp/integrations/integration.py,sha256=4SRcD78ZF9-m65aTxkoF-CZl7XKUsfSr1wppKz_ZgiA,13078
|
14
|
+
universal_mcp/servers/README.md,sha256=ytFlgp8-LO0oogMrHkMOp8SvFTwgsKgv7XhBVZGNTbM,2284
|
15
|
+
universal_mcp/servers/__init__.py,sha256=etFrqXFODIl9oGeqQS-aUxzw4J6pjzYjHl4VPvQaR3A,508
|
16
|
+
universal_mcp/servers/server.py,sha256=1UWvywUzgGVYyIGlaES9tgj_xP_f6EC4bK_vM0nE_tE,9237
|
17
|
+
universal_mcp/stores/README.md,sha256=jrPh_ow4ESH4BDGaSafilhOVaN8oQ9IFlFW-j5Z5hLA,2465
|
18
|
+
universal_mcp/stores/__init__.py,sha256=quvuwhZnpiSLuojf0NfmBx2xpaCulv3fbKtKaSCEmuM,603
|
19
|
+
universal_mcp/stores/store.py,sha256=mxnmOVlDNrr8OKhENWDtCIfK7YeCBQcGdS6I2ogRCsU,6756
|
20
|
+
universal_mcp/tools/README.md,sha256=RuxliOFqV1ZEyeBdj3m8UKfkxAsfrxXh-b6V4ZGAk8I,2468
|
21
|
+
universal_mcp/tools/__init__.py,sha256=Fatza_R0qYWmNF1WQSfUZZKQFu5qf-16JhZzdmyx3KY,333
|
22
|
+
universal_mcp/tools/adapters.py,sha256=gz_sNDc_bseMHWmpQmqhOq65veE-DuK_kJYXGIx0Wi8,1427
|
23
|
+
universal_mcp/tools/func_metadata.py,sha256=zIDXgIBvu5Gh8aNlg-Q7cZZos9Iky75MS0Me0BraXeM,8086
|
24
|
+
universal_mcp/tools/manager.py,sha256=Uqa6aEGAVcZC_Q69L8KQQiW4D_cXvrJQL1lg3_L7GuQ,7526
|
25
|
+
universal_mcp/tools/tools.py,sha256=8YBTaJCM38Nhan9Al6Vlq4FtSULrKlxg1q_o8OL1_FM,3322
|
26
|
+
universal_mcp/utils/__init__.py,sha256=8wi4PGWu-SrFjNJ8U7fr2iFJ1ktqlDmSKj1xYd7KSDc,41
|
27
|
+
universal_mcp/utils/agentr.py,sha256=GlFK5_RJXP3XpIGKLzkIe5nu2rfT6bqSoT0h1hipy9g,3438
|
28
|
+
universal_mcp/utils/common.py,sha256=HEZC2Mhilb8DrGXQG2tboAIw1r4veGilGWjfnPF1lyA,888
|
29
|
+
universal_mcp/utils/docstring_parser.py,sha256=6oIeCjOUirFdVpXdGZt5zDKje6jmCY42-GeYOc_7r2I,11317
|
30
|
+
universal_mcp/utils/installation.py,sha256=lj7_2je7qbXe2tL0JyD3SyNvCSuANLFABaZynwjCGqk,7283
|
31
|
+
universal_mcp/utils/singleton.py,sha256=kolHnbS9yd5C7z-tzaUAD16GgI-thqJXysNi3sZM4No,733
|
32
|
+
universal_mcp/utils/openapi/__inti__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
|
+
universal_mcp/utils/openapi/api_generator.py,sha256=FjtvbnWuI1P8W8wXuKLCirUtsqQ4HI_TuQrhpA4SqTs,4749
|
34
|
+
universal_mcp/utils/openapi/docgen.py,sha256=DNmwlhg_-TRrHa74epyErMTRjV2nutfCQ7seb_Rq5hE,21366
|
35
|
+
universal_mcp/utils/openapi/openapi.py,sha256=r2Kuccn8acawCWjSSzvem_rFmiIVr1sHgU_O03W8q30,36594
|
36
|
+
universal_mcp/utils/openapi/preprocessor.py,sha256=qLYv4ekors5B2OU_YUvXICYQ7XYhAOEPyAnKtnBvNpM,46699
|
37
|
+
universal_mcp/utils/openapi/readme.py,sha256=R2Jp7DUXYNsXPDV6eFTkLiy7MXbSULUj1vHh4O_nB4c,2974
|
38
|
+
universal_mcp/utils/templates/README.md.j2,sha256=Mrm181YX-o_-WEfKs01Bi2RJy43rBiq2j6fTtbWgbTA,401
|
39
|
+
universal_mcp/utils/templates/api_client.py.j2,sha256=972Im7LNUAq3yZTfwDcgivnb-b8u6_JLKWXwoIwXXXQ,908
|
40
|
+
universal_mcp-0.1.16.dist-info/METADATA,sha256=IR1TbIkUM2NxYhZEAQIYvnr2qungmK-DT94mVB15wyY,12122
|
41
|
+
universal_mcp-0.1.16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
42
|
+
universal_mcp-0.1.16.dist-info/entry_points.txt,sha256=QlBrVKmA2jIM0q-C-3TQMNJTTWOsOFQvgedBq2rZTS8,56
|
43
|
+
universal_mcp-0.1.16.dist-info/licenses/LICENSE,sha256=NweDZVPslBAZFzlgByF158b85GR0f5_tLQgq1NS48To,1063
|
44
|
+
universal_mcp-0.1.16.dist-info/RECORD,,
|
@@ -1,247 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: universal-mcp
|
3
|
-
Version: 0.1.15rc7
|
4
|
-
Summary: Universal MCP acts as a middle ware for your API applications. It can store your credentials, authorize, enable disable apps on the fly and much more.
|
5
|
-
Author-email: Manoj Bajaj <manojbajaj95@gmail.com>
|
6
|
-
License: MIT
|
7
|
-
License-File: LICENSE
|
8
|
-
Requires-Python: >=3.11
|
9
|
-
Requires-Dist: cookiecutter>=2.6.0
|
10
|
-
Requires-Dist: gql[all]>=3.5.2
|
11
|
-
Requires-Dist: jinja2>=3.1.3
|
12
|
-
Requires-Dist: jsonref>=1.1.0
|
13
|
-
Requires-Dist: keyring>=25.6.0
|
14
|
-
Requires-Dist: langchain-mcp-adapters>=0.0.3
|
15
|
-
Requires-Dist: litellm>=1.30.7
|
16
|
-
Requires-Dist: loguru>=0.7.3
|
17
|
-
Requires-Dist: mcp>=1.7.1
|
18
|
-
Requires-Dist: posthog>=3.24.0
|
19
|
-
Requires-Dist: pydantic-settings>=2.8.1
|
20
|
-
Requires-Dist: pydantic>=2.11.1
|
21
|
-
Requires-Dist: pyyaml>=6.0.2
|
22
|
-
Requires-Dist: rich>=14.0.0
|
23
|
-
Requires-Dist: typer>=0.15.2
|
24
|
-
Provides-Extra: dev
|
25
|
-
Requires-Dist: litellm>=1.30.7; extra == 'dev'
|
26
|
-
Requires-Dist: pre-commit>=4.2.0; extra == 'dev'
|
27
|
-
Requires-Dist: pyright>=1.1.398; extra == 'dev'
|
28
|
-
Requires-Dist: pytest-asyncio>=0.26.0; extra == 'dev'
|
29
|
-
Requires-Dist: pytest>=8.3.5; extra == 'dev'
|
30
|
-
Requires-Dist: ruff>=0.11.4; extra == 'dev'
|
31
|
-
Provides-Extra: playground
|
32
|
-
Requires-Dist: langchain-openai>=0.3.12; extra == 'playground'
|
33
|
-
Requires-Dist: langgraph-checkpoint-sqlite>=2.0.6; extra == 'playground'
|
34
|
-
Requires-Dist: langgraph>=0.3.24; extra == 'playground'
|
35
|
-
Requires-Dist: litellm>=1.30.7; extra == 'playground'
|
36
|
-
Requires-Dist: python-dotenv>=1.0.1; extra == 'playground'
|
37
|
-
Requires-Dist: streamlit>=1.44.1; extra == 'playground'
|
38
|
-
Requires-Dist: watchdog>=6.0.0; extra == 'playground'
|
39
|
-
Description-Content-Type: text/markdown
|
40
|
-
|
41
|
-
# Universal MCP
|
42
|
-
Universal MCP acts as a middleware layer for your API applications, enabling seamless integration with various services through the Model Context Protocol (MCP). It simplifies credential management, authorization, and dynamic app enablement.
|
43
|
-
|
44
|
-
## 🌟 Features
|
45
|
-
|
46
|
-
- **MCP (Model Context Protocol) Integration**: Seamlessly works with MCP server architecture
|
47
|
-
- **Simplified API Integration**: Connect to services like GitHub, Google Calendar, Gmail, Reddit, Tavily, and more with minimal code
|
48
|
-
- **Managed Authentication**: Built-in support for API keys and OAuth-based authentication flows
|
49
|
-
- **Extensible Architecture**: Easily build and add new app integrations with minimal boilerplate
|
50
|
-
- **Credential Management**: Flexible storage options for API credentials with memory and environment-based implementations
|
51
|
-
- **Tool Management**: Comprehensive tool registration, validation, and execution capabilities
|
52
|
-
- **Multiple Server Types**: Support for local, AgentR, and single-application server configurations
|
53
|
-
|
54
|
-
## 🔧 Installation
|
55
|
-
|
56
|
-
Install Universal MCP using pip:
|
57
|
-
|
58
|
-
```bash
|
59
|
-
pip install universal-mcp
|
60
|
-
```
|
61
|
-
|
62
|
-
## 🚀 Quick Start
|
63
|
-
|
64
|
-
**Important Prerequisite: AgentR API Key (If Using AgentR Integration)**
|
65
|
-
|
66
|
-
If you plan to use integrations with `type: "agentr"` (for services like GitHub, Gmail, Notion via the AgentR platform), or if you run the server with `type: "agentr"`, you first need an AgentR API key:
|
67
|
-
|
68
|
-
1. Visit [https://agentr.dev](https://agentr.dev) to create an account and generate an API key from your dashboard.
|
69
|
-
2. Set it as an environment variable *before* running the MCP server:
|
70
|
-
```bash
|
71
|
-
export AGENTR_API_KEY="your_api_key_here"
|
72
|
-
```
|
73
|
-
|
74
|
-
**1. Create a Configuration File (e.g., `config.json`)**
|
75
|
-
|
76
|
-
This file defines the server settings, credential stores, and the applications to load with their respective integrations.
|
77
|
-
|
78
|
-
```python
|
79
|
-
{
|
80
|
-
"name": "My Local MCP Server",
|
81
|
-
"description": "A server for testing applications locally",
|
82
|
-
"type": "local", # Or "agentr" to load apps dynamically from AgentR
|
83
|
-
"transport": "sse",
|
84
|
-
"port": 8005,
|
85
|
-
"store": {
|
86
|
-
"name": "my_mcp_store",
|
87
|
-
"type": "keyring"
|
88
|
-
},
|
89
|
-
"apps": [
|
90
|
-
{
|
91
|
-
"name": "zenquotes", # App slug
|
92
|
-
"integration": null # No authentication needed
|
93
|
-
},
|
94
|
-
{
|
95
|
-
"name": "tavily",
|
96
|
-
"integration": {
|
97
|
-
"name": "TAVILY_API_KEY", # Unique name for this credential
|
98
|
-
"type": "api_key",
|
99
|
-
"store": {
|
100
|
-
"type": "environment"
|
101
|
-
}
|
102
|
-
}
|
103
|
-
},
|
104
|
-
{
|
105
|
-
"name": "github",
|
106
|
-
"integration": {
|
107
|
-
"name": "github", # Matches the service name in AgentR
|
108
|
-
"type": "agentr" # Uses AgentR platform for auth/creds
|
109
|
-
}
|
110
|
-
}
|
111
|
-
]
|
112
|
-
}
|
113
|
-
```
|
114
|
-
|
115
|
-
*Notes:*
|
116
|
-
* `type: "local"` runs applications defined directly in the config's `apps` list.
|
117
|
-
* `type: "agentr"` connects to the AgentR platform to dynamically load user-enabled apps (ignores the `apps` list in the config) and handle credentials (requires `AGENTR_API_KEY` env var).
|
118
|
-
* `store`: Defines credential storage. `environment` looks for `<INTEGRATION_NAME_UPPERCASE>` env var (e.g., `TAVILY_API_KEY`). `keyring` uses the system's secure storage. `memory` is transient.
|
119
|
-
* `integration`: Configures authentication for each app when using `type: "local"`. `type: "agentr"` uses the AgentR platform for OAuth/credential management. `type: "api_key"` uses the specified `store`.
|
120
|
-
|
121
|
-
**2. Run the Server via CLI**
|
122
|
-
|
123
|
-
Make sure any required environment variables (like `TAVILY_API_KEY` for the example above, or `AGENTR_API_KEY` if using `"agentr"` type server/integrations) are set.
|
124
|
-
|
125
|
-
```bash
|
126
|
-
universal_mcp run -c config.json
|
127
|
-
```
|
128
|
-
|
129
|
-
The server will start, load the configured applications (or connect to AgentR if `type: "agentr"`), and listen for connections based on the `transport` type (`sse`, `stdio`, or `http`).
|
130
|
-
|
131
|
-
## 🛠️ Using Playground
|
132
|
-
|
133
|
-
The `playground` directory provides a runnable example with a FastAPI backend and a Streamlit frontend for interacting with the MCP server.
|
134
|
-
|
135
|
-
**Prerequisites:**
|
136
|
-
|
137
|
-
* Ensure `local_config.json` exists in the project root directory. See `src/playground/README.md` for its format. This configures the *local* MCP server that the playground backend connects to.
|
138
|
-
* Install playground dependencies if needed (e.g., `fastapi`, `streamlit`, `uvicorn`, `langchain`, etc.).
|
139
|
-
|
140
|
-
**Running the Playground:**
|
141
|
-
|
142
|
-
The easiest way is to use the automated startup script from the **project root directory**:
|
143
|
-
|
144
|
-
```bash
|
145
|
-
python src/playground
|
146
|
-
```
|
147
|
-
Refer to `src/playground/README.md` for more detailed setup and usage instructions.
|
148
|
-
|
149
|
-
## 🧩 Available Applications
|
150
|
-
Visit [https://agentr.dev](https://agentr.dev) to check all available applications
|
151
|
-
|
152
|
-
*Authentication Type notes:*
|
153
|
-
* *OAuth (AgentR)*: Typically requires configuring the integration with `type: "agentr"` in your `ServerConfig`. Requires the `AGENTR_API_KEY`.
|
154
|
-
* *API Key (via Integration)*: Requires configuring `type: "api_key"` and a `store` (like `environment` or `keyring`) in your `ServerConfig`.
|
155
|
-
|
156
|
-
## 🔐 Integration Types
|
157
|
-
|
158
|
-
Universal MCP supports different ways to handle authentication for applications:
|
159
|
-
|
160
|
-
### 1. API Key Integration
|
161
|
-
|
162
|
-
For services that authenticate via simple API keys. Configure using `IntegrationConfig` with `type: "api_key"`.
|
163
|
-
|
164
|
-
```python
|
165
|
-
{
|
166
|
-
"name": "tavily",
|
167
|
-
"integration": {
|
168
|
-
"name": "TAVILY_API_KEY",
|
169
|
-
"type": "api_key",
|
170
|
-
"store": {
|
171
|
-
"name": "universal_mcp",
|
172
|
-
"type": "environment" # Or "keyring", "memory"
|
173
|
-
}
|
174
|
-
}
|
175
|
-
}
|
176
|
-
```
|
177
|
-
|
178
|
-
### 2. AgentR Integration
|
179
|
-
|
180
|
-
For services integrated with the AgentR platform, typically handling OAuth flows or centrally managed credentials. Configure using `IntegrationConfig` with `type: "agentr"`. Requires the `AGENTR_API_KEY` environment variable to be set for the MCP server process.
|
181
|
-
|
182
|
-
```python
|
183
|
-
{
|
184
|
-
"name": "github",
|
185
|
-
"integration": {
|
186
|
-
"name": "github", # Matches the service name configured in AgentR
|
187
|
-
"type": "agentr"
|
188
|
-
}
|
189
|
-
}
|
190
|
-
```
|
191
|
-
When an action requiring authorization is called, the `AgentRIntegration` will prompt the user (via the MCP client) to visit a URL to complete the OAuth flow managed by AgentR. This is also the default integration type when using `type: "agentr"` for the main server config.
|
192
|
-
|
193
|
-
### 3. OAuth Integration (Direct - Less Common)
|
194
|
-
|
195
|
-
While `AgentRIntegration` is preferred for OAuth, a direct `OAuthIntegration` class exists but requires manual configuration of client IDs, secrets, and handling callbacks, which is generally more complex to set up outside the AgentR platform.
|
196
|
-
|
197
|
-
## 🤖 CLI Usage
|
198
|
-
|
199
|
-
Universal MCP includes a command-line interface:
|
200
|
-
|
201
|
-
```bash
|
202
|
-
# Run the MCP server using a configuration file
|
203
|
-
universal_mcp run -c config.json
|
204
|
-
|
205
|
-
# Generate API client code and application structure from an OpenAPI schema
|
206
|
-
# Output file name (e.g., 'twitter.py') determines app name ('twitter')
|
207
|
-
universal_mcp generate --schema <path_to_schema.json/yaml> --output <path/to/output_app_name.py> [--no-docstrings]
|
208
|
-
|
209
|
-
# Generate Google-style docstrings for functions in a Python file using an LLM
|
210
|
-
universal_mcp docgen <path/to/file.py> [--model <model_name>] [--api-key <llm_api_key>]
|
211
|
-
|
212
|
-
# Install MCP configuration for supported desktop apps (Claude, Cursor)
|
213
|
-
# Requires AgentR API key for configuration.
|
214
|
-
universal_mcp install claude
|
215
|
-
universal_mcp install cursor
|
216
|
-
|
217
|
-
# Check installed version (standard typer command)
|
218
|
-
universal_mcp --version
|
219
|
-
```
|
220
|
-
|
221
|
-
## 📋 Requirements
|
222
|
-
|
223
|
-
- Python 3.11+
|
224
|
-
- Dependencies (installed automatically via pip):
|
225
|
-
- `mcp-server`
|
226
|
-
- `loguru`
|
227
|
-
- `typer`
|
228
|
-
- `httpx`
|
229
|
-
- `pydantic`
|
230
|
-
- `pyyaml`
|
231
|
-
- `keyring` (optional, for `KeyringStore`)
|
232
|
-
- `litellm` (optional, for `docgen` command)
|
233
|
-
- ... and others specific to certain applications.
|
234
|
-
|
235
|
-
## 📚 Documentation
|
236
|
-
|
237
|
-
For more detailed information about specific components:
|
238
|
-
|
239
|
-
- [Tools Documentation](src/universal_mcp/tools/README.md) - Learn about tool management and conversion
|
240
|
-
- [Servers Documentation](src/universal_mcp/servers/README.md) - Understand different server implementations
|
241
|
-
- [Stores Documentation](src/universal_mcp/stores/README.md) - Explore credential storage options
|
242
|
-
- [Integrations Documentation](src/universal_mcp/integrations/README.md) - Learn about authentication methods
|
243
|
-
|
244
|
-
## 📝 License
|
245
|
-
|
246
|
-
This project is licensed under the MIT License.
|
247
|
-
|
@@ -1,44 +0,0 @@
|
|
1
|
-
universal_mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
universal_mcp/analytics.py,sha256=Dkv8mkc_2T2t5NxLSZzcr3BlmOispj1RKtbB86V1i4M,2306
|
3
|
-
universal_mcp/cli.py,sha256=fqB4CzcA2CAg1m4tzhK0k9X4otHWxaAy2edP1QQYUIQ,8974
|
4
|
-
universal_mcp/config.py,sha256=xqz5VNxtk6Clepjw-aK-HrgMFQLzFuxiDb1fuHGpbxE,3717
|
5
|
-
universal_mcp/exceptions.py,sha256=2A_aIzcwjB99tR4xCFjPkWPf10rBK_785FerJI7Tzns,564
|
6
|
-
universal_mcp/logger.py,sha256=JtAC8ImO74lvt5xepV3W5BIz-u3nZOAY1ecdhmQhub0,2081
|
7
|
-
universal_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
-
universal_mcp/applications/README.md,sha256=eqbizxaTxKH2O1tyIJR2yI0Db5TQxtgPd_vbpWyCa2Y,3527
|
9
|
-
universal_mcp/applications/__init__.py,sha256=zyV_0GyunGBA5OEO1FQsTOsj34SYjnERu5dDJLxd6c0,3133
|
10
|
-
universal_mcp/applications/application.py,sha256=9PfmvVx1csmy0RzaTC71S4DkMD8VxvY3yIsMAt3dQLw,14425
|
11
|
-
universal_mcp/integrations/README.md,sha256=lTAPXO2nivcBe1q7JT6PRa6v9Ns_ZersQMIdw-nmwEA,996
|
12
|
-
universal_mcp/integrations/__init__.py,sha256=tg6Yk59AEhwPsrTp0hZQ3NBfmJuYGu2sNCOXuph-h9k,922
|
13
|
-
universal_mcp/integrations/integration.py,sha256=4SRcD78ZF9-m65aTxkoF-CZl7XKUsfSr1wppKz_ZgiA,13078
|
14
|
-
universal_mcp/servers/README.md,sha256=ytFlgp8-LO0oogMrHkMOp8SvFTwgsKgv7XhBVZGNTbM,2284
|
15
|
-
universal_mcp/servers/__init__.py,sha256=etFrqXFODIl9oGeqQS-aUxzw4J6pjzYjHl4VPvQaR3A,508
|
16
|
-
universal_mcp/servers/server.py,sha256=0oJQQUiwPdG2q79tzsVv3WPMV5YIFbF14PRvBF-SxMQ,9395
|
17
|
-
universal_mcp/stores/README.md,sha256=jrPh_ow4ESH4BDGaSafilhOVaN8oQ9IFlFW-j5Z5hLA,2465
|
18
|
-
universal_mcp/stores/__init__.py,sha256=quvuwhZnpiSLuojf0NfmBx2xpaCulv3fbKtKaSCEmuM,603
|
19
|
-
universal_mcp/stores/store.py,sha256=mxnmOVlDNrr8OKhENWDtCIfK7YeCBQcGdS6I2ogRCsU,6756
|
20
|
-
universal_mcp/tools/README.md,sha256=RuxliOFqV1ZEyeBdj3m8UKfkxAsfrxXh-b6V4ZGAk8I,2468
|
21
|
-
universal_mcp/tools/__init__.py,sha256=Fatza_R0qYWmNF1WQSfUZZKQFu5qf-16JhZzdmyx3KY,333
|
22
|
-
universal_mcp/tools/adapters.py,sha256=gz_sNDc_bseMHWmpQmqhOq65veE-DuK_kJYXGIx0Wi8,1427
|
23
|
-
universal_mcp/tools/func_metadata.py,sha256=4LrOeQ81RnfWjPp9N-tOkw-nr6XosRw6P0EUriNhpu4,8328
|
24
|
-
universal_mcp/tools/manager.py,sha256=OArAbckBay5Lbpu2-oI38zEEbJyM8E_WLB8985B6a70,7718
|
25
|
-
universal_mcp/tools/tools.py,sha256=lg1rM9644OLAmi-yXar-olPCAfsu1ol2Aw9XRuIN7Fk,3383
|
26
|
-
universal_mcp/utils/__init__.py,sha256=8wi4PGWu-SrFjNJ8U7fr2iFJ1ktqlDmSKj1xYd7KSDc,41
|
27
|
-
universal_mcp/utils/agentr.py,sha256=3sobve7Odk8pIAZm3RHTX4Rc21rkBClcXQgXXslbSUA,3490
|
28
|
-
universal_mcp/utils/common.py,sha256=F2Teso1Cs4E1dgMq0ESLJOWJ0n9arLX-YuawfYfZg3I,911
|
29
|
-
universal_mcp/utils/docstring_parser.py,sha256=j7aE-LLnBOPTJI0qXayf0NlYappzxICv5E_hUPNmAlc,11459
|
30
|
-
universal_mcp/utils/installation.py,sha256=1n5X_aIiuY8WNQn6Oji_gZ-aiRmNXxrg-qYRv-pGjxw,10195
|
31
|
-
universal_mcp/utils/singleton.py,sha256=kolHnbS9yd5C7z-tzaUAD16GgI-thqJXysNi3sZM4No,733
|
32
|
-
universal_mcp/utils/openapi/__inti__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
|
-
universal_mcp/utils/openapi/api_generator.py,sha256=aNzrcglYXL6mQizFQUuiFFKTPuEPgTC1unr6NT_U0VM,4771
|
34
|
-
universal_mcp/utils/openapi/docgen.py,sha256=zPmZ-b-fK6xk-dwHEx2hwShN-iquPD_O15CGuPwlj2k,21870
|
35
|
-
universal_mcp/utils/openapi/openapi.py,sha256=PeCj01skdvBaYvGedSShgUrzZ2GhEpPX8IOyTvq-ubk,37284
|
36
|
-
universal_mcp/utils/openapi/preprocessor.py,sha256=zMCsHv9lNIrIlAMyF39cIm0-c2vydrtbtQjJ0rjcLL8,48765
|
37
|
-
universal_mcp/utils/openapi/readme.py,sha256=wTg2D0sPKppPmGn7b-vtD5hAGRv8DLEAuxMNzqBeuEs,3032
|
38
|
-
universal_mcp/utils/templates/README.md.j2,sha256=Mrm181YX-o_-WEfKs01Bi2RJy43rBiq2j6fTtbWgbTA,401
|
39
|
-
universal_mcp/utils/templates/api_client.py.j2,sha256=972Im7LNUAq3yZTfwDcgivnb-b8u6_JLKWXwoIwXXXQ,908
|
40
|
-
universal_mcp-0.1.15rc7.dist-info/METADATA,sha256=Ij-KJ9juKlrmOEiRiJkUK6_rAye0RYrXxjbTZWAz3_w,9886
|
41
|
-
universal_mcp-0.1.15rc7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
42
|
-
universal_mcp-0.1.15rc7.dist-info/entry_points.txt,sha256=QlBrVKmA2jIM0q-C-3TQMNJTTWOsOFQvgedBq2rZTS8,56
|
43
|
-
universal_mcp-0.1.15rc7.dist-info/licenses/LICENSE,sha256=NweDZVPslBAZFzlgByF158b85GR0f5_tLQgq1NS48To,1063
|
44
|
-
universal_mcp-0.1.15rc7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|