universal-mcp 0.1.15rc5__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/analytics.py +7 -1
- universal_mcp/applications/README.md +122 -0
- universal_mcp/applications/__init__.py +51 -56
- universal_mcp/applications/application.py +255 -82
- universal_mcp/cli.py +27 -43
- universal_mcp/config.py +16 -48
- universal_mcp/exceptions.py +8 -0
- universal_mcp/integrations/__init__.py +1 -3
- universal_mcp/integrations/integration.py +18 -2
- universal_mcp/logger.py +31 -29
- universal_mcp/servers/server.py +6 -18
- universal_mcp/stores/store.py +2 -12
- universal_mcp/tools/__init__.py +12 -1
- universal_mcp/tools/adapters.py +11 -0
- universal_mcp/tools/func_metadata.py +11 -15
- universal_mcp/tools/manager.py +163 -117
- universal_mcp/tools/tools.py +6 -13
- universal_mcp/utils/agentr.py +2 -6
- universal_mcp/utils/common.py +33 -0
- universal_mcp/utils/docstring_parser.py +4 -13
- universal_mcp/utils/installation.py +67 -184
- universal_mcp/utils/openapi/__inti__.py +0 -0
- universal_mcp/utils/{api_generator.py → openapi/api_generator.py} +2 -4
- universal_mcp/utils/{docgen.py → openapi/docgen.py} +17 -54
- universal_mcp/utils/openapi/openapi.py +882 -0
- universal_mcp/utils/openapi/preprocessor.py +1093 -0
- universal_mcp/utils/{readme.py → openapi/readme.py} +21 -37
- universal_mcp-0.1.16.dist-info/METADATA +282 -0
- universal_mcp-0.1.16.dist-info/RECORD +44 -0
- universal_mcp-0.1.16.dist-info/licenses/LICENSE +21 -0
- universal_mcp/utils/openapi.py +0 -646
- universal_mcp-0.1.15rc5.dist-info/METADATA +0 -245
- universal_mcp-0.1.15rc5.dist-info/RECORD +0 -39
- /universal_mcp/{templates → utils/templates}/README.md.j2 +0 -0
- /universal_mcp/{templates → utils/templates}/api_client.py.j2 +0 -0
- {universal_mcp-0.1.15rc5.dist-info → universal_mcp-0.1.16.dist-info}/WHEEL +0 -0
- {universal_mcp-0.1.15rc5.dist-info → universal_mcp-0.1.16.dist-info}/entry_points.txt +0 -0
@@ -1,245 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: universal-mcp
|
3
|
-
Version: 0.1.15rc5
|
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
|
-
Requires-Python: >=3.11
|
8
|
-
Requires-Dist: cookiecutter>=2.6.0
|
9
|
-
Requires-Dist: gql[all]>=3.5.2
|
10
|
-
Requires-Dist: jinja2>=3.1.3
|
11
|
-
Requires-Dist: jsonref>=1.1.0
|
12
|
-
Requires-Dist: keyring>=25.6.0
|
13
|
-
Requires-Dist: litellm>=1.30.7
|
14
|
-
Requires-Dist: loguru>=0.7.3
|
15
|
-
Requires-Dist: mcp>=1.6.0
|
16
|
-
Requires-Dist: posthog>=3.24.0
|
17
|
-
Requires-Dist: pydantic-settings>=2.8.1
|
18
|
-
Requires-Dist: pydantic>=2.11.1
|
19
|
-
Requires-Dist: pyyaml>=6.0.2
|
20
|
-
Requires-Dist: rich>=14.0.0
|
21
|
-
Requires-Dist: typer>=0.15.2
|
22
|
-
Provides-Extra: dev
|
23
|
-
Requires-Dist: litellm>=1.30.7; extra == 'dev'
|
24
|
-
Requires-Dist: pre-commit>=4.2.0; extra == 'dev'
|
25
|
-
Requires-Dist: pyright>=1.1.398; extra == 'dev'
|
26
|
-
Requires-Dist: pytest-asyncio>=0.26.0; extra == 'dev'
|
27
|
-
Requires-Dist: pytest>=8.3.5; extra == 'dev'
|
28
|
-
Requires-Dist: ruff>=0.11.4; extra == 'dev'
|
29
|
-
Provides-Extra: playground
|
30
|
-
Requires-Dist: langchain-mcp-adapters>=0.0.3; extra == 'playground'
|
31
|
-
Requires-Dist: langchain-openai>=0.3.12; extra == 'playground'
|
32
|
-
Requires-Dist: langgraph-checkpoint-sqlite>=2.0.6; extra == 'playground'
|
33
|
-
Requires-Dist: langgraph>=0.3.24; extra == 'playground'
|
34
|
-
Requires-Dist: python-dotenv>=1.0.1; extra == 'playground'
|
35
|
-
Requires-Dist: streamlit>=1.44.1; extra == 'playground'
|
36
|
-
Requires-Dist: watchdog>=6.0.0; extra == 'playground'
|
37
|
-
Description-Content-Type: text/markdown
|
38
|
-
|
39
|
-
# Universal MCP
|
40
|
-
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.
|
41
|
-
|
42
|
-
## 🌟 Features
|
43
|
-
|
44
|
-
- **MCP (Model Context Protocol) Integration**: Seamlessly works with MCP server architecture
|
45
|
-
- **Simplified API Integration**: Connect to services like GitHub, Google Calendar, Gmail, Reddit, Tavily, and more with minimal code
|
46
|
-
- **Managed Authentication**: Built-in support for API keys and OAuth-based authentication flows
|
47
|
-
- **Extensible Architecture**: Easily build and add new app integrations with minimal boilerplate
|
48
|
-
- **Credential Management**: Flexible storage options for API credentials with memory and environment-based implementations
|
49
|
-
- **Tool Management**: Comprehensive tool registration, validation, and execution capabilities
|
50
|
-
- **Multiple Server Types**: Support for local, AgentR, and single-application server configurations
|
51
|
-
|
52
|
-
## 🔧 Installation
|
53
|
-
|
54
|
-
Install Universal MCP using pip:
|
55
|
-
|
56
|
-
```bash
|
57
|
-
pip install universal-mcp
|
58
|
-
```
|
59
|
-
|
60
|
-
## 🚀 Quick Start
|
61
|
-
|
62
|
-
**Important Prerequisite: AgentR API Key (If Using AgentR Integration)**
|
63
|
-
|
64
|
-
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:
|
65
|
-
|
66
|
-
1. Visit [https://agentr.dev](https://agentr.dev) to create an account and generate an API key from your dashboard.
|
67
|
-
2. Set it as an environment variable *before* running the MCP server:
|
68
|
-
```bash
|
69
|
-
export AGENTR_API_KEY="your_api_key_here"
|
70
|
-
```
|
71
|
-
|
72
|
-
**1. Create a Configuration File (e.g., `config.json`)**
|
73
|
-
|
74
|
-
This file defines the server settings, credential stores, and the applications to load with their respective integrations.
|
75
|
-
|
76
|
-
```python
|
77
|
-
{
|
78
|
-
"name": "My Local MCP Server",
|
79
|
-
"description": "A server for testing applications locally",
|
80
|
-
"type": "local", # Or "agentr" to load apps dynamically from AgentR
|
81
|
-
"transport": "sse",
|
82
|
-
"port": 8005,
|
83
|
-
"store": {
|
84
|
-
"name": "my_mcp_store",
|
85
|
-
"type": "keyring"
|
86
|
-
},
|
87
|
-
"apps": [
|
88
|
-
{
|
89
|
-
"name": "zenquotes", # App slug
|
90
|
-
"integration": null # No authentication needed
|
91
|
-
},
|
92
|
-
{
|
93
|
-
"name": "tavily",
|
94
|
-
"integration": {
|
95
|
-
"name": "TAVILY_API_KEY", # Unique name for this credential
|
96
|
-
"type": "api_key",
|
97
|
-
"store": {
|
98
|
-
"type": "environment"
|
99
|
-
}
|
100
|
-
}
|
101
|
-
},
|
102
|
-
{
|
103
|
-
"name": "github",
|
104
|
-
"integration": {
|
105
|
-
"name": "github", # Matches the service name in AgentR
|
106
|
-
"type": "agentr" # Uses AgentR platform for auth/creds
|
107
|
-
}
|
108
|
-
}
|
109
|
-
]
|
110
|
-
}
|
111
|
-
```
|
112
|
-
|
113
|
-
*Notes:*
|
114
|
-
* `type: "local"` runs applications defined directly in the config's `apps` list.
|
115
|
-
* `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).
|
116
|
-
* `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.
|
117
|
-
* `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`.
|
118
|
-
|
119
|
-
**2. Run the Server via CLI**
|
120
|
-
|
121
|
-
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.
|
122
|
-
|
123
|
-
```bash
|
124
|
-
universal_mcp run -c config.json
|
125
|
-
```
|
126
|
-
|
127
|
-
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`).
|
128
|
-
|
129
|
-
## 🛠️ Using Playground
|
130
|
-
|
131
|
-
The `playground` directory provides a runnable example with a FastAPI backend and a Streamlit frontend for interacting with the MCP server.
|
132
|
-
|
133
|
-
**Prerequisites:**
|
134
|
-
|
135
|
-
* 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.
|
136
|
-
* Install playground dependencies if needed (e.g., `fastapi`, `streamlit`, `uvicorn`, `langchain`, etc.).
|
137
|
-
|
138
|
-
**Running the Playground:**
|
139
|
-
|
140
|
-
The easiest way is to use the automated startup script from the **project root directory**:
|
141
|
-
|
142
|
-
```bash
|
143
|
-
python src/playground
|
144
|
-
```
|
145
|
-
Refer to `src/playground/README.md` for more detailed setup and usage instructions.
|
146
|
-
|
147
|
-
## 🧩 Available Applications
|
148
|
-
Visit [https://agentr.dev](https://agentr.dev) to check all available applications
|
149
|
-
|
150
|
-
*Authentication Type notes:*
|
151
|
-
* *OAuth (AgentR)*: Typically requires configuring the integration with `type: "agentr"` in your `ServerConfig`. Requires the `AGENTR_API_KEY`.
|
152
|
-
* *API Key (via Integration)*: Requires configuring `type: "api_key"` and a `store` (like `environment` or `keyring`) in your `ServerConfig`.
|
153
|
-
|
154
|
-
## 🔐 Integration Types
|
155
|
-
|
156
|
-
Universal MCP supports different ways to handle authentication for applications:
|
157
|
-
|
158
|
-
### 1. API Key Integration
|
159
|
-
|
160
|
-
For services that authenticate via simple API keys. Configure using `IntegrationConfig` with `type: "api_key"`.
|
161
|
-
|
162
|
-
```python
|
163
|
-
{
|
164
|
-
"name": "tavily",
|
165
|
-
"integration": {
|
166
|
-
"name": "TAVILY_API_KEY",
|
167
|
-
"type": "api_key",
|
168
|
-
"store": {
|
169
|
-
"name": "universal_mcp",
|
170
|
-
"type": "environment" # Or "keyring", "memory"
|
171
|
-
}
|
172
|
-
}
|
173
|
-
}
|
174
|
-
```
|
175
|
-
|
176
|
-
### 2. AgentR Integration
|
177
|
-
|
178
|
-
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.
|
179
|
-
|
180
|
-
```python
|
181
|
-
{
|
182
|
-
"name": "github",
|
183
|
-
"integration": {
|
184
|
-
"name": "github", # Matches the service name configured in AgentR
|
185
|
-
"type": "agentr"
|
186
|
-
}
|
187
|
-
}
|
188
|
-
```
|
189
|
-
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.
|
190
|
-
|
191
|
-
### 3. OAuth Integration (Direct - Less Common)
|
192
|
-
|
193
|
-
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.
|
194
|
-
|
195
|
-
## 🤖 CLI Usage
|
196
|
-
|
197
|
-
Universal MCP includes a command-line interface:
|
198
|
-
|
199
|
-
```bash
|
200
|
-
# Run the MCP server using a configuration file
|
201
|
-
universal_mcp run -c config.json
|
202
|
-
|
203
|
-
# Generate API client code and application structure from an OpenAPI schema
|
204
|
-
# Output file name (e.g., 'twitter.py') determines app name ('twitter')
|
205
|
-
universal_mcp generate --schema <path_to_schema.json/yaml> --output <path/to/output_app_name.py> [--no-docstrings]
|
206
|
-
|
207
|
-
# Generate Google-style docstrings for functions in a Python file using an LLM
|
208
|
-
universal_mcp docgen <path/to/file.py> [--model <model_name>] [--api-key <llm_api_key>]
|
209
|
-
|
210
|
-
# Install MCP configuration for supported desktop apps (Claude, Cursor)
|
211
|
-
# Requires AgentR API key for configuration.
|
212
|
-
universal_mcp install claude
|
213
|
-
universal_mcp install cursor
|
214
|
-
|
215
|
-
# Check installed version (standard typer command)
|
216
|
-
universal_mcp --version
|
217
|
-
```
|
218
|
-
|
219
|
-
## 📋 Requirements
|
220
|
-
|
221
|
-
- Python 3.11+
|
222
|
-
- Dependencies (installed automatically via pip):
|
223
|
-
- `mcp-server`
|
224
|
-
- `loguru`
|
225
|
-
- `typer`
|
226
|
-
- `httpx`
|
227
|
-
- `pydantic`
|
228
|
-
- `pyyaml`
|
229
|
-
- `keyring` (optional, for `KeyringStore`)
|
230
|
-
- `litellm` (optional, for `docgen` command)
|
231
|
-
- ... and others specific to certain applications.
|
232
|
-
|
233
|
-
## 📚 Documentation
|
234
|
-
|
235
|
-
For more detailed information about specific components:
|
236
|
-
|
237
|
-
- [Tools Documentation](src/universal_mcp/tools/README.md) - Learn about tool management and conversion
|
238
|
-
- [Servers Documentation](src/universal_mcp/servers/README.md) - Understand different server implementations
|
239
|
-
- [Stores Documentation](src/universal_mcp/stores/README.md) - Explore credential storage options
|
240
|
-
- [Integrations Documentation](src/universal_mcp/integrations/README.md) - Learn about authentication methods
|
241
|
-
|
242
|
-
## 📝 License
|
243
|
-
|
244
|
-
This project is licensed under the MIT License.
|
245
|
-
|
@@ -1,39 +0,0 @@
|
|
1
|
-
universal_mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
universal_mcp/analytics.py,sha256=aGCg0Okpcy06W70qCA9I8_ySOiCgAtzJAIWAdhBsOeA,2212
|
3
|
-
universal_mcp/cli.py,sha256=XujnWHxz5NVxQjwu2BRHUcGC--Vp98M32n8hTsEqayI,8689
|
4
|
-
universal_mcp/config.py,sha256=xqz5VNxtk6Clepjw-aK-HrgMFQLzFuxiDb1fuHGpbxE,3717
|
5
|
-
universal_mcp/exceptions.py,sha256=WApedvzArNujD0gZfUofYBxjQo97ZDJLqDibtLWZoRk,373
|
6
|
-
universal_mcp/logger.py,sha256=JtAC8ImO74lvt5xepV3W5BIz-u3nZOAY1ecdhmQhub0,2081
|
7
|
-
universal_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
-
universal_mcp/applications/__init__.py,sha256=ZjV0P55Ej0vjIQ_bCSNatWTX-VphDJ6OGePWBu3bu3U,3196
|
9
|
-
universal_mcp/applications/application.py,sha256=0eC9D4HHRwIGpuFusaCxTZ0u64U68VbBpRSxjxGB5y8,8152
|
10
|
-
universal_mcp/integrations/README.md,sha256=lTAPXO2nivcBe1q7JT6PRa6v9Ns_ZersQMIdw-nmwEA,996
|
11
|
-
universal_mcp/integrations/__init__.py,sha256=tg6Yk59AEhwPsrTp0hZQ3NBfmJuYGu2sNCOXuph-h9k,922
|
12
|
-
universal_mcp/integrations/integration.py,sha256=genBiaWuzCs-XCf3UD1j8PQYyGU3GiVO4uupSdJRHnA,12601
|
13
|
-
universal_mcp/servers/README.md,sha256=ytFlgp8-LO0oogMrHkMOp8SvFTwgsKgv7XhBVZGNTbM,2284
|
14
|
-
universal_mcp/servers/__init__.py,sha256=etFrqXFODIl9oGeqQS-aUxzw4J6pjzYjHl4VPvQaR3A,508
|
15
|
-
universal_mcp/servers/server.py,sha256=0oJQQUiwPdG2q79tzsVv3WPMV5YIFbF14PRvBF-SxMQ,9395
|
16
|
-
universal_mcp/stores/README.md,sha256=jrPh_ow4ESH4BDGaSafilhOVaN8oQ9IFlFW-j5Z5hLA,2465
|
17
|
-
universal_mcp/stores/__init__.py,sha256=quvuwhZnpiSLuojf0NfmBx2xpaCulv3fbKtKaSCEmuM,603
|
18
|
-
universal_mcp/stores/store.py,sha256=lYaFd-9YKC404BPeqzNw_Xm3ziQjksZyvQtaW1yd9FM,6900
|
19
|
-
universal_mcp/templates/README.md.j2,sha256=Mrm181YX-o_-WEfKs01Bi2RJy43rBiq2j6fTtbWgbTA,401
|
20
|
-
universal_mcp/templates/api_client.py.j2,sha256=972Im7LNUAq3yZTfwDcgivnb-b8u6_JLKWXwoIwXXXQ,908
|
21
|
-
universal_mcp/tools/README.md,sha256=RuxliOFqV1ZEyeBdj3m8UKfkxAsfrxXh-b6V4ZGAk8I,2468
|
22
|
-
universal_mcp/tools/__init__.py,sha256=GgK8CAxskkoif4WCaXsjs4zTgqN9VcVMyQa2G2LaYJ4,92
|
23
|
-
universal_mcp/tools/adapters.py,sha256=oCF042vsOKP9bUT6000YbYEmOpOiroXEnMdDMs847CU,1235
|
24
|
-
universal_mcp/tools/func_metadata.py,sha256=bxcwwKkHcITZQXt1eal7rFr5NGCrC0SLSGZwOsyCVKo,7985
|
25
|
-
universal_mcp/tools/manager.py,sha256=Ne37cLlyk0oku0iUXbc6BmzNH-3a98oWcpe_nlyZRtU,7516
|
26
|
-
universal_mcp/tools/tools.py,sha256=2ddZdi618xTs36iM062Pc6cnIbVP17L4NRBMNiFuv1k,3306
|
27
|
-
universal_mcp/utils/__init__.py,sha256=8wi4PGWu-SrFjNJ8U7fr2iFJ1ktqlDmSKj1xYd7KSDc,41
|
28
|
-
universal_mcp/utils/agentr.py,sha256=3sobve7Odk8pIAZm3RHTX4Rc21rkBClcXQgXXslbSUA,3490
|
29
|
-
universal_mcp/utils/api_generator.py,sha256=x3LkJm3tXgl2qVQq-ZQW86w7IqbErEdFTfwBP3aOwyI,4763
|
30
|
-
universal_mcp/utils/docgen.py,sha256=zPmZ-b-fK6xk-dwHEx2hwShN-iquPD_O15CGuPwlj2k,21870
|
31
|
-
universal_mcp/utils/docstring_parser.py,sha256=j7aE-LLnBOPTJI0qXayf0NlYappzxICv5E_hUPNmAlc,11459
|
32
|
-
universal_mcp/utils/installation.py,sha256=1n5X_aIiuY8WNQn6Oji_gZ-aiRmNXxrg-qYRv-pGjxw,10195
|
33
|
-
universal_mcp/utils/openapi.py,sha256=fd4rfiT_hFmEHtzGg-tM3FMSAn-AT0EskKfOc71--jE,23317
|
34
|
-
universal_mcp/utils/readme.py,sha256=Q4E3RidWVg0ngYBGZCKcoA4eX6wlkCpvU-clU0E7Q20,3305
|
35
|
-
universal_mcp/utils/singleton.py,sha256=kolHnbS9yd5C7z-tzaUAD16GgI-thqJXysNi3sZM4No,733
|
36
|
-
universal_mcp-0.1.15rc5.dist-info/METADATA,sha256=OXwhLXpEIbkAsrFWmwx6aO_nhtHjjhif2yN-2kthT_M,9833
|
37
|
-
universal_mcp-0.1.15rc5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
38
|
-
universal_mcp-0.1.15rc5.dist-info/entry_points.txt,sha256=QlBrVKmA2jIM0q-C-3TQMNJTTWOsOFQvgedBq2rZTS8,56
|
39
|
-
universal_mcp-0.1.15rc5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|