1
1
# PyPI Query MCP Server
2
2
3
+ [ ![ PyPI version] ( https://img.shields.io/pypi/v/pypi-query-mcp-server.svg )] ( https://pypi.org/project/pypi-query-mcp-server/ )
4
+
3
5
A Model Context Protocol (MCP) server for querying PyPI package information, dependencies, and compatibility checking.
4
6
5
7
## Features
@@ -11,31 +13,127 @@ A Model Context Protocol (MCP) server for querying PyPI package information, dep
11
13
- ⚡ Fast async operations with caching
12
14
- 🛠️ Easy integration with MCP clients
13
15
14
- ## Quick Start
16
+ ## Installation
15
17
16
- ### Installation
18
+ ### Using uvx (recommended)
17
19
18
20
``` bash
19
- # Install from PyPI (coming soon)
21
+ # Run directly with uvx
22
+ uvx pypi-query-mcp-server
23
+
24
+ # Or install and run with specific script
25
+ uvx --from pypi-query-mcp-server pypi-query-mcp
26
+ ```
27
+
28
+ ### Using pip
29
+
30
+ ``` bash
31
+ # Install from PyPI
20
32
pip install pypi-query-mcp-server
21
33
22
- # Or install from source
34
+ # Run the server
35
+ python -m pypi_query_mcp.server
36
+ ```
37
+
38
+ ### From source
39
+
40
+ ``` bash
23
41
git clone https://github.com/loonghao/pypi-query-mcp-server.git
24
42
cd pypi-query-mcp-server
25
- poetry install
43
+ uv sync
44
+ uv run pypi-query-mcp
26
45
```
27
46
28
- ### Usage
47
+ ## Configuration
29
48
30
- ``` bash
31
- # Start the MCP server
32
- pypi-query-mcp
49
+ ### Claude Desktop
33
50
34
- # Or run directly with Python
35
- python -m pypi_query_mcp.server
51
+ Add to your Claude Desktop configuration file:
52
+
53
+ ** MacOS** : ` ~/Library/Application Support/Claude/claude_desktop_config.json `
54
+ ** Windows** : ` %APPDATA%/Claude/claude_desktop_config.json `
55
+
56
+ ``` json
57
+ {
58
+ "mcpServers" : {
59
+ "pypi-query" : {
60
+ "command" : " uvx" ,
61
+ "args" : [" --from" , " pypi-query-mcp-server" , " pypi-query-mcp" ],
62
+ "env" : {
63
+ "PYPI_INDEX_URL" : " https://pypi.org/simple/" ,
64
+ "CACHE_TTL" : " 3600"
65
+ }
66
+ }
67
+ }
68
+ }
36
69
```
37
70
38
- ### Available MCP Tools
71
+ ### Cline
72
+
73
+ Add to your Cline MCP settings (` cline_mcp_settings.json ` ):
74
+
75
+ ``` json
76
+ {
77
+ "mcpServers" : {
78
+ "pypi-query" : {
79
+ "command" : " uvx" ,
80
+ "args" : [" --from" , " pypi-query-mcp-server" , " pypi-query-mcp" ],
81
+ "env" : {
82
+ "PYPI_INDEX_URL" : " https://pypi.org/simple/" ,
83
+ "CACHE_TTL" : " 3600"
84
+ }
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ ### Cursor
91
+
92
+ Add to your Cursor MCP configuration (` .cursor/mcp.json ` ):
93
+
94
+ ``` json
95
+ {
96
+ "mcpServers" : {
97
+ "pypi-query" : {
98
+ "command" : " uvx" ,
99
+ "args" : [" --from" , " pypi-query-mcp-server" , " pypi-query-mcp" ],
100
+ "env" : {
101
+ "PYPI_INDEX_URL" : " https://pypi.org/simple/" ,
102
+ "CACHE_TTL" : " 3600"
103
+ }
104
+ }
105
+ }
106
+ }
107
+ ```
108
+
109
+ ### Windsurf
110
+
111
+ Add to your Windsurf MCP configuration (` ~/.codeium/windsurf/mcp_config.json ` ):
112
+
113
+ ``` json
114
+ {
115
+ "mcpServers" : {
116
+ "pypi-query" : {
117
+ "command" : " uvx" ,
118
+ "args" : [" --from" , " pypi-query-mcp-server" , " pypi-query-mcp" ],
119
+ "env" : {
120
+ "PYPI_INDEX_URL" : " https://pypi.org/simple/" ,
121
+ "CACHE_TTL" : " 3600"
122
+ }
123
+ }
124
+ }
125
+ }
126
+ ```
127
+
128
+ ### Environment Variables
129
+
130
+ - ` PYPI_INDEX_URL ` : PyPI index URL (default: https://pypi.org/simple/ )
131
+ - ` CACHE_TTL ` : Cache time-to-live in seconds (default: 3600)
132
+ - ` PRIVATE_PYPI_URL ` : Private PyPI repository URL (optional)
133
+ - ` PRIVATE_PYPI_USERNAME ` : Private PyPI username (optional)
134
+ - ` PRIVATE_PYPI_PASSWORD ` : Private PyPI password (optional)
135
+
136
+ ## Available MCP Tools
39
137
40
138
The server provides the following MCP tools:
41
139
@@ -45,7 +143,31 @@ The server provides the following MCP tools:
45
143
4 . ** check_package_python_compatibility** - Check Python version compatibility
46
144
5 . ** get_package_compatible_python_versions** - Get all compatible Python versions
47
145
48
- ### Example Usage with MCP Client
146
+ ## Usage Examples
147
+
148
+ Once configured in your MCP client (Claude Desktop, Cline, Cursor, Windsurf), you can ask questions like:
149
+
150
+ - "What are the dependencies of Django 4.2?"
151
+ - "Is FastAPI compatible with Python 3.9?"
152
+ - "Show me all versions of requests package"
153
+ - "What Python versions does numpy support?"
154
+ - "Get detailed information about the pandas package"
155
+
156
+ ### Example Conversations
157
+
158
+ ** User** : "Check if Django 4.2 is compatible with Python 3.9"
159
+
160
+ ** AI Assistant** : I'll check Django 4.2's compatibility with Python 3.9 for you.
161
+
162
+ * [ Uses get_package_info and check_package_python_compatibility tools] *
163
+
164
+ ** User** : "What are the main dependencies of FastAPI?"
165
+
166
+ ** AI Assistant** : Let me get the dependency information for FastAPI.
167
+
168
+ * [ Uses get_package_dependencies tool] *
169
+
170
+ ### Programmatic Usage
49
171
50
172
``` python
51
173
# Example: Check if Django is compatible with Python 3.9
0 commit co 3085 mments