vaquill-mcp 0.1.0__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.
- vaquill_mcp-0.1.0/.github/workflows/publish.yml +39 -0
- vaquill_mcp-0.1.0/.gitignore +43 -0
- vaquill_mcp-0.1.0/LICENSE +21 -0
- vaquill_mcp-0.1.0/PKG-INFO +203 -0
- vaquill_mcp-0.1.0/README.md +172 -0
- vaquill_mcp-0.1.0/pyproject.toml +57 -0
- vaquill_mcp-0.1.0/src/vaquill_mcp/__init__.py +20 -0
- vaquill_mcp-0.1.0/src/vaquill_mcp/__main__.py +13 -0
- vaquill_mcp-0.1.0/src/vaquill_mcp/config.py +59 -0
- vaquill_mcp-0.1.0/src/vaquill_mcp/descriptions.py +63 -0
- vaquill_mcp-0.1.0/src/vaquill_mcp/py.typed +0 -0
- vaquill_mcp-0.1.0/src/vaquill_mcp/server.py +205 -0
- vaquill_mcp-0.1.0/tests/__init__.py +0 -0
- vaquill_mcp-0.1.0/tests/conftest.py +200 -0
- vaquill_mcp-0.1.0/tests/test_config.py +94 -0
- vaquill_mcp-0.1.0/tests/test_server.py +286 -0
- vaquill_mcp-0.1.0/uv.lock +1581 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
|
|
13
|
+
- name: Install uv
|
|
14
|
+
uses: astral-sh/setup-uv@v4
|
|
15
|
+
|
|
16
|
+
- name: Build package
|
|
17
|
+
run: uv build
|
|
18
|
+
|
|
19
|
+
- name: Upload dist artifacts
|
|
20
|
+
uses: actions/upload-artifact@v4
|
|
21
|
+
with:
|
|
22
|
+
name: dist
|
|
23
|
+
path: dist/
|
|
24
|
+
|
|
25
|
+
publish:
|
|
26
|
+
needs: build
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
environment: pypi
|
|
29
|
+
permissions:
|
|
30
|
+
id-token: write
|
|
31
|
+
steps:
|
|
32
|
+
- name: Download dist artifacts
|
|
33
|
+
uses: actions/download-artifact@v4
|
|
34
|
+
with:
|
|
35
|
+
name: dist
|
|
36
|
+
path: dist/
|
|
37
|
+
|
|
38
|
+
- name: Publish to PyPI
|
|
39
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Byte-compiled
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
*.egg
|
|
11
|
+
MANIFEST
|
|
12
|
+
|
|
13
|
+
# Virtual environments
|
|
14
|
+
.venv/
|
|
15
|
+
env/
|
|
16
|
+
venv/
|
|
17
|
+
|
|
18
|
+
# Testing
|
|
19
|
+
.pytest_cache/
|
|
20
|
+
htmlcov/
|
|
21
|
+
.coverage
|
|
22
|
+
.coverage.*
|
|
23
|
+
coverage.xml
|
|
24
|
+
|
|
25
|
+
# Type checkers
|
|
26
|
+
.mypy_cache/
|
|
27
|
+
.pytype/
|
|
28
|
+
.pyre/
|
|
29
|
+
|
|
30
|
+
# IDE
|
|
31
|
+
.idea/
|
|
32
|
+
.vscode/
|
|
33
|
+
|
|
34
|
+
# Environment
|
|
35
|
+
.env
|
|
36
|
+
.envrc
|
|
37
|
+
|
|
38
|
+
# Ruff
|
|
39
|
+
.ruff_cache/
|
|
40
|
+
|
|
41
|
+
# OS
|
|
42
|
+
.DS_Store
|
|
43
|
+
Thumbs.db
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vaquill
|
|
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.
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vaquill-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for Vaquill legal research API - search 13M+ Indian court judgments via AI
|
|
5
|
+
Project-URL: Homepage, https://www.vaquill.ai
|
|
6
|
+
Project-URL: Documentation, https://www.vaquill.ai/docs/api-reference
|
|
7
|
+
Project-URL: Repository, https://github.com/vaquill/vaquill-mcp
|
|
8
|
+
Project-URL: Issues, https://github.com/vaquill/vaquill-mcp/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/vaquill/vaquill-mcp/blob/main/CHANGELOG.md
|
|
10
|
+
Author-email: Vaquill <dev@vaquill.ai>
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: ai,india,law,legal,mcp,rag,research,vaquill
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: fastmcp>=3.0.0
|
|
25
|
+
Requires-Dist: httpx>=0.27.0
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: respx>=0.22; extra == 'dev'
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
# vaquill-mcp
|
|
33
|
+
|
|
34
|
+
MCP server for [Vaquill](https://www.vaquill.ai) legal research API. Search 13M+ Indian court judgments, ask AI-powered legal questions, resolve citations, and traverse citation networks — all from your AI tools.
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
### Prerequisites
|
|
39
|
+
|
|
40
|
+
Get your API key from [vaquill.ai/dashboard/api-keys](https://www.vaquill.ai/dashboard/api-keys)
|
|
41
|
+
|
|
42
|
+
### Claude Desktop
|
|
43
|
+
|
|
44
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"mcpServers": {
|
|
49
|
+
"vaquill": {
|
|
50
|
+
"command": "uvx",
|
|
51
|
+
"args": ["vaquill-mcp"],
|
|
52
|
+
"env": {
|
|
53
|
+
"VAQUILL_API_KEY": "vq_key_your_key_here"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Claude Code
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
claude mcp add vaquill -- uvx vaquill-mcp
|
|
64
|
+
# Then set the env var in your shell: export VAQUILL_API_KEY=vq_key_...
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Or add to `.claude/settings.json`:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"mcpServers": {
|
|
72
|
+
"vaquill": {
|
|
73
|
+
"command": "uvx",
|
|
74
|
+
"args": ["vaquill-mcp"],
|
|
75
|
+
"env": {
|
|
76
|
+
"VAQUILL_API_KEY": "vq_key_your_key_here"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Cursor
|
|
84
|
+
|
|
85
|
+
Add to Cursor Settings > MCP Servers:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"mcpServers": {
|
|
90
|
+
"vaquill": {
|
|
91
|
+
"command": "uvx",
|
|
92
|
+
"args": ["vaquill-mcp"],
|
|
93
|
+
"env": {
|
|
94
|
+
"VAQUILL_API_KEY": "vq_key_your_key_here"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### VS Code (Copilot)
|
|
102
|
+
|
|
103
|
+
Add to `.vscode/settings.json`:
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"mcp": {
|
|
108
|
+
"servers": {
|
|
109
|
+
"vaquill": {
|
|
110
|
+
"command": "uvx",
|
|
111
|
+
"args": ["vaquill-mcp"],
|
|
112
|
+
"env": {
|
|
113
|
+
"VAQUILL_API_KEY": "vq_key_your_key_here"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Windsurf
|
|
122
|
+
|
|
123
|
+
Add to `~/.windsurf/settings.json`:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"mcpServers": {
|
|
128
|
+
"vaquill": {
|
|
129
|
+
"command": "uvx",
|
|
130
|
+
"args": ["vaquill-mcp"],
|
|
131
|
+
"env": {
|
|
132
|
+
"VAQUILL_API_KEY": "vq_key_your_key_here"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Available Tools
|
|
140
|
+
|
|
141
|
+
| Tool | Description | Credits |
|
|
142
|
+
|------|-------------|---------|
|
|
143
|
+
| `ask_legal_question` | AI-powered legal Q&A grounded in court judgments. Standard (fast) or deep (thorough) modes. | 0.5 - 2.0 |
|
|
144
|
+
| `search_legal_cases` | Boolean keyword search with AND/OR/NOT operators. Filter by court, year, country. | 1.0 |
|
|
145
|
+
| `quick_search` | Fast compact search returning top 3-5 results with essentials only. | 0.1 |
|
|
146
|
+
| `resolve_citation` | Resolve any citation format (SCC, AIR, SCR, MANU) to canonical case record. | 0.1 |
|
|
147
|
+
| `search_cases_by_citation` | Search cases by citation text or case name with filters. | 0.1 |
|
|
148
|
+
| `lookup_case` | Full case details with citation treatment stats (followed, overruled, etc.). | 0.1 |
|
|
149
|
+
| `get_citation_network` | Traverse citation graph: which cases cite/are cited by a case. 1-3 hops. | 0.2 |
|
|
150
|
+
| `get_pricing` | Get current API credit pricing (no auth required). | Free |
|
|
151
|
+
|
|
152
|
+
## Environment Variables
|
|
153
|
+
|
|
154
|
+
| Variable | Required | Default | Description |
|
|
155
|
+
|----------|----------|---------|-------------|
|
|
156
|
+
| `VAQUILL_API_KEY` | Yes | - | API key (`vq_key_...`) from dashboard |
|
|
157
|
+
| `VAQUILL_BASE_URL` | No | `https://api.vaquill.ai` | API base URL |
|
|
158
|
+
| `VAQUILL_TIMEOUT` | No | `120` | Request timeout in seconds |
|
|
159
|
+
|
|
160
|
+
## Example Usage
|
|
161
|
+
|
|
162
|
+
Once configured, you can ask your AI assistant things like:
|
|
163
|
+
|
|
164
|
+
- "Search for Supreme Court cases on Section 302 IPC"
|
|
165
|
+
- "What is the legal test for negligence in Indian tort law?"
|
|
166
|
+
- "Resolve the citation AIR 1978 SC 597"
|
|
167
|
+
- "Look up the case Maneka Gandhi vs Union of India and show treatment stats"
|
|
168
|
+
- "Show the citation network around ADM Jabalpur vs Shivkant Shukla"
|
|
169
|
+
- "Compare murder and culpable homicide under IPC" (uses deep mode)
|
|
170
|
+
|
|
171
|
+
## Development
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# Clone and install
|
|
175
|
+
git clone https://github.com/vaquill/vaquill-mcp.git
|
|
176
|
+
cd vaquill-mcp
|
|
177
|
+
uv sync --all-extras
|
|
178
|
+
|
|
179
|
+
# Run locally
|
|
180
|
+
VAQUILL_API_KEY=vq_key_... uv run vaquill-mcp
|
|
181
|
+
|
|
182
|
+
# Run tests
|
|
183
|
+
uv run pytest
|
|
184
|
+
|
|
185
|
+
# Test with FastMCP inspector
|
|
186
|
+
uv run fastmcp dev src/vaquill_mcp/server.py
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## How It Works
|
|
190
|
+
|
|
191
|
+
This package is a thin MCP wrapper around the [Vaquill Developer API](https://api.vaquill.ai/external/docs). At startup, it fetches the OpenAPI spec from the live API and auto-generates MCP tools using [FastMCP](https://github.com/jlowin/fastmcp). Tool names and descriptions are customized for optimal LLM performance.
|
|
192
|
+
|
|
193
|
+
Because the spec is fetched at startup (not bundled), tools automatically reflect any API changes without a package update.
|
|
194
|
+
|
|
195
|
+
## Credits & Pricing
|
|
196
|
+
|
|
197
|
+
API calls consume credits. Check current pricing at [vaquill.ai/pricing](https://www.vaquill.ai/pricing) or use the `get_pricing` tool.
|
|
198
|
+
|
|
199
|
+
1 credit = $0.10 USD = 10 INR
|
|
200
|
+
|
|
201
|
+
## License
|
|
202
|
+
|
|
203
|
+
MIT
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# vaquill-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for [Vaquill](https://www.vaquill.ai) legal research API. Search 13M+ Indian court judgments, ask AI-powered legal questions, resolve citations, and traverse citation networks — all from your AI tools.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
Get your API key from [vaquill.ai/dashboard/api-keys](https://www.vaquill.ai/dashboard/api-keys)
|
|
10
|
+
|
|
11
|
+
### Claude Desktop
|
|
12
|
+
|
|
13
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"mcpServers": {
|
|
18
|
+
"vaquill": {
|
|
19
|
+
"command": "uvx",
|
|
20
|
+
"args": ["vaquill-mcp"],
|
|
21
|
+
"env": {
|
|
22
|
+
"VAQUILL_API_KEY": "vq_key_your_key_here"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Claude Code
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
claude mcp add vaquill -- uvx vaquill-mcp
|
|
33
|
+
# Then set the env var in your shell: export VAQUILL_API_KEY=vq_key_...
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Or add to `.claude/settings.json`:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"vaquill": {
|
|
42
|
+
"command": "uvx",
|
|
43
|
+
"args": ["vaquill-mcp"],
|
|
44
|
+
"env": {
|
|
45
|
+
"VAQUILL_API_KEY": "vq_key_your_key_here"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Cursor
|
|
53
|
+
|
|
54
|
+
Add to Cursor Settings > MCP Servers:
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"mcpServers": {
|
|
59
|
+
"vaquill": {
|
|
60
|
+
"command": "uvx",
|
|
61
|
+
"args": ["vaquill-mcp"],
|
|
62
|
+
"env": {
|
|
63
|
+
"VAQUILL_API_KEY": "vq_key_your_key_here"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### VS Code (Copilot)
|
|
71
|
+
|
|
72
|
+
Add to `.vscode/settings.json`:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"mcp": {
|
|
77
|
+
"servers": {
|
|
78
|
+
"vaquill": {
|
|
79
|
+
"command": "uvx",
|
|
80
|
+
"args": ["vaquill-mcp"],
|
|
81
|
+
"env": {
|
|
82
|
+
"VAQUILL_API_KEY": "vq_key_your_key_here"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Windsurf
|
|
91
|
+
|
|
92
|
+
Add to `~/.windsurf/settings.json`:
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"mcpServers": {
|
|
97
|
+
"vaquill": {
|
|
98
|
+
"command": "uvx",
|
|
99
|
+
"args": ["vaquill-mcp"],
|
|
100
|
+
"env": {
|
|
101
|
+
"VAQUILL_API_KEY": "vq_key_your_key_here"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Available Tools
|
|
109
|
+
|
|
110
|
+
| Tool | Description | Credits |
|
|
111
|
+
|------|-------------|---------|
|
|
112
|
+
| `ask_legal_question` | AI-powered legal Q&A grounded in court judgments. Standard (fast) or deep (thorough) modes. | 0.5 - 2.0 |
|
|
113
|
+
| `search_legal_cases` | Boolean keyword search with AND/OR/NOT operators. Filter by court, year, country. | 1.0 |
|
|
114
|
+
| `quick_search` | Fast compact search returning top 3-5 results with essentials only. | 0.1 |
|
|
115
|
+
| `resolve_citation` | Resolve any citation format (SCC, AIR, SCR, MANU) to canonical case record. | 0.1 |
|
|
116
|
+
| `search_cases_by_citation` | Search cases by citation text or case name with filters. | 0.1 |
|
|
117
|
+
| `lookup_case` | Full case details with citation treatment stats (followed, overruled, etc.). | 0.1 |
|
|
118
|
+
| `get_citation_network` | Traverse citation graph: which cases cite/are cited by a case. 1-3 hops. | 0.2 |
|
|
119
|
+
| `get_pricing` | Get current API credit pricing (no auth required). | Free |
|
|
120
|
+
|
|
121
|
+
## Environment Variables
|
|
122
|
+
|
|
123
|
+
| Variable | Required | Default | Description |
|
|
124
|
+
|----------|----------|---------|-------------|
|
|
125
|
+
| `VAQUILL_API_KEY` | Yes | - | API key (`vq_key_...`) from dashboard |
|
|
126
|
+
| `VAQUILL_BASE_URL` | No | `https://api.vaquill.ai` | API base URL |
|
|
127
|
+
| `VAQUILL_TIMEOUT` | No | `120` | Request timeout in seconds |
|
|
128
|
+
|
|
129
|
+
## Example Usage
|
|
130
|
+
|
|
131
|
+
Once configured, you can ask your AI assistant things like:
|
|
132
|
+
|
|
133
|
+
- "Search for Supreme Court cases on Section 302 IPC"
|
|
134
|
+
- "What is the legal test for negligence in Indian tort law?"
|
|
135
|
+
- "Resolve the citation AIR 1978 SC 597"
|
|
136
|
+
- "Look up the case Maneka Gandhi vs Union of India and show treatment stats"
|
|
137
|
+
- "Show the citation network around ADM Jabalpur vs Shivkant Shukla"
|
|
138
|
+
- "Compare murder and culpable homicide under IPC" (uses deep mode)
|
|
139
|
+
|
|
140
|
+
## Development
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Clone and install
|
|
144
|
+
git clone https://github.com/vaquill/vaquill-mcp.git
|
|
145
|
+
cd vaquill-mcp
|
|
146
|
+
uv sync --all-extras
|
|
147
|
+
|
|
148
|
+
# Run locally
|
|
149
|
+
VAQUILL_API_KEY=vq_key_... uv run vaquill-mcp
|
|
150
|
+
|
|
151
|
+
# Run tests
|
|
152
|
+
uv run pytest
|
|
153
|
+
|
|
154
|
+
# Test with FastMCP inspector
|
|
155
|
+
uv run fastmcp dev src/vaquill_mcp/server.py
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## How It Works
|
|
159
|
+
|
|
160
|
+
This package is a thin MCP wrapper around the [Vaquill Developer API](https://api.vaquill.ai/external/docs). At startup, it fetches the OpenAPI spec from the live API and auto-generates MCP tools using [FastMCP](https://github.com/jlowin/fastmcp). Tool names and descriptions are customized for optimal LLM performance.
|
|
161
|
+
|
|
162
|
+
Because the spec is fetched at startup (not bundled), tools automatically reflect any API changes without a package update.
|
|
163
|
+
|
|
164
|
+
## Credits & Pricing
|
|
165
|
+
|
|
166
|
+
API calls consume credits. Check current pricing at [vaquill.ai/pricing](https://www.vaquill.ai/pricing) or use the `get_pricing` tool.
|
|
167
|
+
|
|
168
|
+
1 credit = $0.10 USD = 10 INR
|
|
169
|
+
|
|
170
|
+
## License
|
|
171
|
+
|
|
172
|
+
MIT
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.26"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vaquill-mcp"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "MCP server for Vaquill legal research API - search 13M+ Indian court judgments via AI"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Vaquill", email = "dev@vaquill.ai" },
|
|
14
|
+
]
|
|
15
|
+
keywords = ["mcp", "legal", "research", "vaquill", "ai", "rag", "law", "india"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
25
|
+
"Typing :: Typed",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"fastmcp>=3.0.0",
|
|
29
|
+
"httpx>=0.27.0",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.scripts]
|
|
33
|
+
vaquill-mcp = "vaquill_mcp.__main__:main"
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://www.vaquill.ai"
|
|
37
|
+
Documentation = "https://www.vaquill.ai/docs/api-reference"
|
|
38
|
+
Repository = "https://github.com/vaquill/vaquill-mcp"
|
|
39
|
+
Issues = "https://github.com/vaquill/vaquill-mcp/issues"
|
|
40
|
+
Changelog = "https://github.com/vaquill/vaquill-mcp/blob/main/CHANGELOG.md"
|
|
41
|
+
|
|
42
|
+
[project.optional-dependencies]
|
|
43
|
+
dev = [
|
|
44
|
+
"pytest>=8.0",
|
|
45
|
+
"pytest-asyncio>=0.24",
|
|
46
|
+
"respx>=0.22",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
[tool.hatch.version]
|
|
50
|
+
path = "src/vaquill_mcp/__init__.py"
|
|
51
|
+
|
|
52
|
+
[tool.hatch.build.targets.wheel]
|
|
53
|
+
packages = ["src/vaquill_mcp"]
|
|
54
|
+
|
|
55
|
+
[tool.pytest.ini_options]
|
|
56
|
+
testpaths = ["tests"]
|
|
57
|
+
asyncio_mode = "auto"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Vaquill MCP Server - Legal research tools powered by 13M+ court judgments."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
|
|
5
|
+
__version__ = "0.1.0"
|
|
6
|
+
__all__ = ["__version__", "create_server"]
|
|
7
|
+
|
|
8
|
+
# PEP 593: Libraries should add NullHandler to prevent "No handler found"
|
|
9
|
+
# warnings. The application (CLI entry point) configures actual handlers.
|
|
10
|
+
logging.getLogger(__name__).addHandler(logging.NullHandler())
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def create_server(): # noqa: ANN201
|
|
14
|
+
"""Create and configure the Vaquill MCP server.
|
|
15
|
+
|
|
16
|
+
Lazy import to avoid loading FastMCP when only ``__version__`` is needed.
|
|
17
|
+
"""
|
|
18
|
+
from vaquill_mcp.server import create_server as _create_server
|
|
19
|
+
|
|
20
|
+
return _create_server()
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""Entry point for `python -m vaquill_mcp` and `uvx vaquill-mcp`."""
|
|
2
|
+
|
|
3
|
+
from vaquill_mcp.server import create_server
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def main() -> None:
|
|
7
|
+
"""Create the Vaquill MCP server and run it on stdio transport."""
|
|
8
|
+
server = create_server()
|
|
9
|
+
server.run(transport="stdio")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
if __name__ == "__main__":
|
|
13
|
+
main()
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""Configuration for the Vaquill MCP server.
|
|
2
|
+
|
|
3
|
+
Reads settings from environment variables:
|
|
4
|
+
- VAQUILL_API_KEY (required) - Your API key from https://www.vaquill.ai/dashboard/api-keys
|
|
5
|
+
- VAQUILL_BASE_URL (optional) - API base URL, defaults to https://api.vaquill.ai
|
|
6
|
+
- VAQUILL_TIMEOUT (optional) - Request timeout in seconds, defaults to 120
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import os
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def get_api_key() -> str:
|
|
13
|
+
"""Read API key from environment.
|
|
14
|
+
|
|
15
|
+
Raises:
|
|
16
|
+
ValueError: If VAQUILL_API_KEY is not set or empty.
|
|
17
|
+
"""
|
|
18
|
+
key = os.environ.get("VAQUILL_API_KEY", "").strip()
|
|
19
|
+
if not key:
|
|
20
|
+
raise ValueError(
|
|
21
|
+
"VAQUILL_API_KEY environment variable is required.\n"
|
|
22
|
+
"Get your API key at https://www.vaquill.ai/dashboard/api-keys\n\n"
|
|
23
|
+
"Set it in your MCP client config:\n"
|
|
24
|
+
' "env": { "VAQUILL_API_KEY": "vq_key_..." }'
|
|
25
|
+
)
|
|
26
|
+
return key
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_base_url() -> str:
|
|
30
|
+
"""Read base URL from environment or use production default.
|
|
31
|
+
|
|
32
|
+
Raises:
|
|
33
|
+
ValueError: If the URL scheme is not http or https.
|
|
34
|
+
"""
|
|
35
|
+
url = os.environ.get("VAQUILL_BASE_URL", "https://api.vaquill.ai").rstrip("/")
|
|
36
|
+
if not url.startswith(("http://", "https://")):
|
|
37
|
+
raise ValueError(
|
|
38
|
+
f"VAQUILL_BASE_URL must start with http:// or https://, got: {url!r}"
|
|
39
|
+
)
|
|
40
|
+
return url
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def get_timeout() -> float:
|
|
44
|
+
"""Read timeout from environment or use default.
|
|
45
|
+
|
|
46
|
+
Default is 120 seconds -- the /ask endpoint in deep mode can take
|
|
47
|
+
up to 90 seconds (RAG retrieval + LLM planning + generation + refinement).
|
|
48
|
+
|
|
49
|
+
Raises:
|
|
50
|
+
ValueError: If the timeout is not a positive number.
|
|
51
|
+
"""
|
|
52
|
+
raw = os.environ.get("VAQUILL_TIMEOUT", "120")
|
|
53
|
+
try:
|
|
54
|
+
timeout = float(raw)
|
|
55
|
+
except ValueError:
|
|
56
|
+
raise ValueError(f"VAQUILL_TIMEOUT must be a number, got: {raw!r}") from None
|
|
57
|
+
if timeout <= 0:
|
|
58
|
+
raise ValueError(f"VAQUILL_TIMEOUT must be positive, got: {timeout}")
|
|
59
|
+
return timeout
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""LLM-optimized tool descriptions for Vaquill MCP tools.
|
|
2
|
+
|
|
3
|
+
Each description tells the LLM WHEN to use the tool, WHAT it returns,
|
|
4
|
+
and the credit cost. Kept concise (50-100 words) for efficient context usage.
|
|
5
|
+
|
|
6
|
+
These override the verbose OpenAPI descriptions which contain multi-paragraph
|
|
7
|
+
markdown with tables, code examples, and SSE documentation — far too long
|
|
8
|
+
for an LLM tool description.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
TOOL_DESCRIPTIONS: dict[str, str] = {
|
|
12
|
+
"ask_legal_question": (
|
|
13
|
+
"Ask a legal question and get an AI-generated answer grounded in 13M+ Indian "
|
|
14
|
+
"court judgments. Use 'standard' mode (fast, 0.5 credits) for factual questions "
|
|
15
|
+
"or 'deep' mode (thorough multi-hop analysis, 2.0 credits) for complex comparisons. "
|
|
16
|
+
"Pass chatHistory for follow-up questions. Returns answer text with numbered source "
|
|
17
|
+
"citations including case name, court, year, relevance score, excerpt, and PDF link."
|
|
18
|
+
),
|
|
19
|
+
"search_legal_cases": (
|
|
20
|
+
"Search the legal corpus using boolean keyword queries. Supports AND, OR, NOT "
|
|
21
|
+
"operators and quoted phrases (e.g., '\"beyond reasonable doubt\" AND murder'). "
|
|
22
|
+
"Filter by court type, court name, year range, and country code. Returns paginated "
|
|
23
|
+
"results with content text, citation, court, relevance score, highlighted snippet, "
|
|
24
|
+
"and PDF URL. Cost: 1 credit per search."
|
|
25
|
+
),
|
|
26
|
+
"quick_search": (
|
|
27
|
+
"Fast compact legal search returning top 3-5 results with just the essentials: "
|
|
28
|
+
"title, citation, court, year, summary excerpt, and PDF link. Same boolean query "
|
|
29
|
+
"syntax as search_legal_cases but returns fewer, flatter results. Best when you "
|
|
30
|
+
"need a quick overview rather than detailed results. Cost: 0.1 credits."
|
|
31
|
+
),
|
|
32
|
+
"resolve_citation": (
|
|
33
|
+
"Resolve any Indian legal citation format to its canonical case record. Accepts "
|
|
34
|
+
"SCC, AIR, SCR, MANU, SCALE, INSC formats (e.g., '(2019) 11 SCC 706' or "
|
|
35
|
+
"'AIR 1976 SC 1207'). Returns case details and all known citation aliases/formats. "
|
|
36
|
+
"Returns found=false (not an error) when citation cannot be resolved. Cost: 0.1 credits."
|
|
37
|
+
),
|
|
38
|
+
"search_cases_by_citation": (
|
|
39
|
+
"Search for legal cases by citation text or case name. Use when you know part of "
|
|
40
|
+
"a case name (e.g., 'Maneka Gandhi') or a partial citation. Filter by court code "
|
|
41
|
+
"(SC, DEL, BOM, MAD, etc.), year range, and validity status (GOOD_LAW, OVERRULED, "
|
|
42
|
+
"DISTINGUISHED, etc.). Returns up to 50 matching cases with metadata. Cost: 0.1 credits."
|
|
43
|
+
),
|
|
44
|
+
"lookup_case": (
|
|
45
|
+
"Get full details for a specific case by its citation. Returns comprehensive case "
|
|
46
|
+
"metadata, all known citation aliases, and citation treatment statistics showing "
|
|
47
|
+
"how many times the case was followed, distinguished, overruled, approved, or "
|
|
48
|
+
"referred. Use after resolve_citation or search_cases_by_citation for deep case "
|
|
49
|
+
"analysis. Cost: 0.1 credits."
|
|
50
|
+
),
|
|
51
|
+
"get_citation_network": (
|
|
52
|
+
"Traverse the citation network around a case. Returns nodes (cases) and edges "
|
|
53
|
+
"(citing relationships) with treatment types (followed, distinguished, overruled). "
|
|
54
|
+
"Specify direction: 'outbound' (cases this cites), 'inbound' (cases citing this), "
|
|
55
|
+
"or 'both'. Set depth (1-3 hops) and limit (1-100 nodes). Useful for understanding "
|
|
56
|
+
"a case's legal influence. Cost: 0.2 credits."
|
|
57
|
+
),
|
|
58
|
+
"get_pricing": (
|
|
59
|
+
"Get current API credit pricing. Returns per-endpoint credit costs and "
|
|
60
|
+
"credit-to-currency conversion rates (1 credit = $0.10 USD = 10 INR). "
|
|
61
|
+
"No authentication required. Use to check costs before making API calls."
|
|
62
|
+
),
|
|
63
|
+
}
|