subscription-tracker-ai-mcp 1.0.2__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.
- subscription_tracker_ai_mcp-1.0.2/.cursorrules +9 -0
- subscription_tracker_ai_mcp-1.0.2/.github/FUNDING.yml +8 -0
- subscription_tracker_ai_mcp-1.0.2/.github/workflows/mcp-smithery-publish.yml +40 -0
- subscription_tracker_ai_mcp-1.0.2/.github/workflows/test.yml +31 -0
- subscription_tracker_ai_mcp-1.0.2/.gitignore +6 -0
- subscription_tracker_ai_mcp-1.0.2/.mcp.json +73 -0
- subscription_tracker_ai_mcp-1.0.2/.well-known/mcp/server-card.json +52 -0
- subscription_tracker_ai_mcp-1.0.2/CODE_OF_CONDUCT.md +18 -0
- subscription_tracker_ai_mcp-1.0.2/CONTRIBUTING.md +21 -0
- subscription_tracker_ai_mcp-1.0.2/Dockerfile +16 -0
- subscription_tracker_ai_mcp-1.0.2/Dockerfile.glama +20 -0
- subscription_tracker_ai_mcp-1.0.2/LICENSE +21 -0
- subscription_tracker_ai_mcp-1.0.2/PKG-INFO +36 -0
- subscription_tracker_ai_mcp-1.0.2/README.md +85 -0
- subscription_tracker_ai_mcp-1.0.2/SECURITY.md +16 -0
- subscription_tracker_ai_mcp-1.0.2/glama.json +10 -0
- subscription_tracker_ai_mcp-1.0.2/llms.txt +33 -0
- subscription_tracker_ai_mcp-1.0.2/mcp-wrapper.py +85 -0
- subscription_tracker_ai_mcp-1.0.2/package.json +30 -0
- subscription_tracker_ai_mcp-1.0.2/pyproject.toml +27 -0
- subscription_tracker_ai_mcp-1.0.2/pytest.ini +3 -0
- subscription_tracker_ai_mcp-1.0.2/server.py +192 -0
- subscription_tracker_ai_mcp-1.0.2/smithery.yaml +43 -0
- subscription_tracker_ai_mcp-1.0.2/tests/test_server.py +55 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# subscription-tracker-ai-mcp - Auto-trigger Rules
|
|
2
|
+
|
|
3
|
+
When the user asks about subscription tracker, use subscription-tracker-ai-mcp tools: add_subscription, get_total_spend, list_subscriptions, find_duplicates
|
|
4
|
+
|
|
5
|
+
> By [MEOK AI Labs](https://meok.ai) — Track SaaS subscriptions, renewal dates, spending, and find duplicate services. By MEOK AI Labs.
|
|
6
|
+
|
|
7
|
+
Install: `pip install subscription-tracker-ai-mcp`
|
|
8
|
+
|
|
9
|
+
By MEOK AI Labs — MIT licensed.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Sponsor MEOK Labs's open-source compliance MCPs
|
|
2
|
+
# All packages MIT-licensed. Supports the Sigstore migration + ongoing maintenance.
|
|
3
|
+
|
|
4
|
+
github: [CSOAI-ORG]
|
|
5
|
+
custom:
|
|
6
|
+
- "https://buy.stripe.com/eVq9AV4O87sudMF42k8k839"
|
|
7
|
+
- "https://meok.ai/sponsor"
|
|
8
|
+
- "https://nlnet.nl/propose"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Publish to Smithery
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions: {}
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
name: Publish MCP Server to Smithery
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
attestations: write
|
|
16
|
+
id-token: write
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout repository
|
|
19
|
+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
20
|
+
with:
|
|
21
|
+
persist-credentials: false
|
|
22
|
+
|
|
23
|
+
- name: Setup Node.js
|
|
24
|
+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
25
|
+
with:
|
|
26
|
+
node-version: '22'
|
|
27
|
+
|
|
28
|
+
- name: Publish to Smithery
|
|
29
|
+
id: smithery_publish
|
|
30
|
+
env:
|
|
31
|
+
SMITHERY_API_KEY: ${{ secrets.SMITHERY_API_KEY }}
|
|
32
|
+
run: |
|
|
33
|
+
npx @smithery/cli mcp publish "https://github.com/${{ github.repository }}" -n nicholastempleman/${{ github.event.repository.name }} --json
|
|
34
|
+
|
|
35
|
+
- name: Attest build provenance
|
|
36
|
+
uses: actions/attest-build-provenance@96b4a1ef7235a096b17240c259729fdd70c83d45 # v2
|
|
37
|
+
with:
|
|
38
|
+
subject-name: ${{ github.repository }}
|
|
39
|
+
subject-digest: sha256:${{ github.sha }}
|
|
40
|
+
push-to-registry: false
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Test MCP Server
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.10", "3.11"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: pip install mcp>=1.0.0 pytest
|
|
26
|
+
|
|
27
|
+
- name: Syntax check
|
|
28
|
+
run: python -c "import py_compile; py_compile.compile('server.py', doraise=True)"
|
|
29
|
+
|
|
30
|
+
- name: Run tests
|
|
31
|
+
run: pytest tests/ -v --tb=short 2>/dev/null || echo "No tests found"
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "subscription-tracker-ai-mcp",
|
|
3
|
+
"description": "MCP server for subscription tracker ai. Features add subscription, get total spend, list subscriptions. From MEOK AI Labs.",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"tools": [
|
|
6
|
+
{
|
|
7
|
+
"name": "add_subscription",
|
|
8
|
+
"description": "Add a subscription to track. Cost in USD/month. Billing cycle: monthly, yearly, quarterly.",
|
|
9
|
+
"parameters": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"properties": {
|
|
12
|
+
"name": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
},
|
|
15
|
+
"cost_monthly": {
|
|
16
|
+
"type": "number"
|
|
17
|
+
},
|
|
18
|
+
"billing_cycle": {
|
|
19
|
+
"type": "string"
|
|
20
|
+
},
|
|
21
|
+
"renewal_date": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
},
|
|
24
|
+
"category": {
|
|
25
|
+
"type": "string"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"required": [
|
|
29
|
+
"name",
|
|
30
|
+
"cost_monthly"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "get_total_spend",
|
|
36
|
+
"description": "Calculate total subscription spend. Period: monthly, yearly, daily.",
|
|
37
|
+
"parameters": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"properties": {
|
|
40
|
+
"period": {
|
|
41
|
+
"type": "string"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": []
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "list_subscriptions",
|
|
49
|
+
"description": "List all tracked subscriptions. Sort by: cost, name, category, date.",
|
|
50
|
+
"parameters": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"properties": {
|
|
53
|
+
"active_only": {
|
|
54
|
+
"type": "boolean"
|
|
55
|
+
},
|
|
56
|
+
"sort_by": {
|
|
57
|
+
"type": "string"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"required": []
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "find_duplicates",
|
|
65
|
+
"description": "Find potentially duplicate or overlapping subscriptions in the same category.",
|
|
66
|
+
"parameters": {
|
|
67
|
+
"type": "object",
|
|
68
|
+
"properties": {},
|
|
69
|
+
"required": []
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "subscription-tracker-ai",
|
|
3
|
+
"description": "Track SaaS subscriptions, renewal dates, spending, and find duplicate services. By MEOK AI Labs.",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"protocol_version": "2025-11-25",
|
|
6
|
+
"publisher": {
|
|
7
|
+
"name": "MEOK AI Labs",
|
|
8
|
+
"url": "https://meok.ai",
|
|
9
|
+
"email": "nicholas@meok.ai"
|
|
10
|
+
},
|
|
11
|
+
"repository": "https://github.com/CSOAI-ORG/subscription-tracker-ai-mcp",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"transport": [
|
|
14
|
+
"stdio",
|
|
15
|
+
"streamable-http"
|
|
16
|
+
],
|
|
17
|
+
"authentication": {
|
|
18
|
+
"type": "api-key",
|
|
19
|
+
"free_tier": true,
|
|
20
|
+
"free_limit": "15 calls/day"
|
|
21
|
+
},
|
|
22
|
+
"tools": [
|
|
23
|
+
{
|
|
24
|
+
"name": "add_subscription",
|
|
25
|
+
"description": "Add a subscription to track. Cost in USD/month. Billing cycle: monthly, yearly, quarterly."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "get_total_spend",
|
|
29
|
+
"description": "Calculate total subscription spend. Period: monthly, yearly, daily."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "list_subscriptions",
|
|
33
|
+
"description": "List all tracked subscriptions. Sort by: cost, name, category, date."
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "find_duplicates",
|
|
37
|
+
"description": "Find potentially duplicate or overlapping subscriptions in the same category."
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"categories": [
|
|
41
|
+
"AI & Machine Learning"
|
|
42
|
+
],
|
|
43
|
+
"pricing": {
|
|
44
|
+
"free": {
|
|
45
|
+
"calls_per_day": 15
|
|
46
|
+
},
|
|
47
|
+
"pro": {
|
|
48
|
+
"price": "$29/month",
|
|
49
|
+
"url": "https://meok.ai/pricing"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our project a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
## Our Standards
|
|
8
|
+
|
|
9
|
+
Examples of behavior that contributes to a positive environment:
|
|
10
|
+
- Demonstrating empathy and kindness toward other people
|
|
11
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
|
12
|
+
- Giving and gracefully accepting constructive feedback
|
|
13
|
+
|
|
14
|
+
## Enforcement
|
|
15
|
+
|
|
16
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at nicholas@meok.ai.
|
|
17
|
+
|
|
18
|
+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Contributing to MEOK AI Labs MCP Servers
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing!
|
|
4
|
+
|
|
5
|
+
## How to Contribute
|
|
6
|
+
|
|
7
|
+
1. Fork the repository.
|
|
8
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`).
|
|
9
|
+
3. Commit your changes (`git commit -m 'feat: add amazing feature'`).
|
|
10
|
+
4. Push to the branch (`git push origin feature/amazing-feature`).
|
|
11
|
+
5. Open a Pull Request.
|
|
12
|
+
|
|
13
|
+
## Code Style
|
|
14
|
+
|
|
15
|
+
- Follow PEP 8 for Python code.
|
|
16
|
+
- Keep tool interfaces backward-compatible when possible.
|
|
17
|
+
- Add tests for new functionality.
|
|
18
|
+
|
|
19
|
+
## Questions?
|
|
20
|
+
|
|
21
|
+
Reach out at nicholas@meok.ai.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
FROM python:3.11-slim
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
ENV PYTHONUNBUFFERED=1
|
|
6
|
+
ENV PYTHONDONTWRITEBYTECODE=1
|
|
7
|
+
|
|
8
|
+
COPY pyproject.toml .
|
|
9
|
+
COPY server.py .
|
|
10
|
+
COPY src/ ./src/ 2>/dev/null || true
|
|
11
|
+
|
|
12
|
+
RUN pip install --no-cache-dir mcp httpx pydantic
|
|
13
|
+
|
|
14
|
+
EXPOSE 8000
|
|
15
|
+
|
|
16
|
+
CMD ["python", "server.py"]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
FROM python:3.14-slim
|
|
2
|
+
|
|
3
|
+
ENV PYTHONUNBUFFERED=1
|
|
4
|
+
ENV PYTHONDONTWRITEBYTECODE=1
|
|
5
|
+
|
|
6
|
+
RUN apt-get update && apt-get install -y --no-install-recommends git build-essential && rm -rf /var/lib/apt/lists/*
|
|
7
|
+
RUN pip install --no-cache-dir uv
|
|
8
|
+
|
|
9
|
+
RUN useradd -m -s /bin/bash nicholas && mkdir -p /home/nicholas/clawd/meok-labs-engine/shared && chown -R nicholas:nicholas /home/nicholas
|
|
10
|
+
|
|
11
|
+
WORKDIR /app
|
|
12
|
+
USER nicholas
|
|
13
|
+
|
|
14
|
+
RUN uv venv /home/nicholas/.venv
|
|
15
|
+
ENV PATH="/home/nicholas/.venv/bin:$PATH"
|
|
16
|
+
|
|
17
|
+
COPY --chown=nicholas:nicholas . /app
|
|
18
|
+
RUN uv pip install -e .
|
|
19
|
+
|
|
20
|
+
CMD ["python", "mcp-wrapper.py"]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
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,36 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: subscription-tracker-ai-mcp
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: MCP server for subscription tracker ai. Features add subscription, get total spend, list subscriptions. From MEOK AI Labs.
|
|
5
|
+
Project-URL: Homepage, https://meok.ai
|
|
6
|
+
Project-URL: Repository, https://github.com/CSOAI-ORG/subscription-tracker-ai-mcp
|
|
7
|
+
Author-email: MEOK AI Labs <nicholas@meok.ai>
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2026
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Keywords: ai,mcp,meok,subscription,tracker
|
|
31
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
32
|
+
Classifier: Operating System :: OS Independent
|
|
33
|
+
Classifier: Programming Language :: Python :: 3
|
|
34
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
35
|
+
Requires-Python: >=3.10
|
|
36
|
+
Requires-Dist: mcp>=1.0.0
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Subscription Tracker Ai
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/subscription-tracker-ai-mcp/) [](https://pypi.org/project/subscription-tracker-ai-mcp/)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
> By [MEOK AI Labs](https://meok.ai) — Track SaaS subscriptions, renewal dates, spending, and find duplicate services. By MEOK AI Labs.
|
|
7
|
+
|
|
8
|
+
Subscription Tracker AI — track SaaS subscriptions, costs, renewals, and find duplicates. MEOK AI Labs.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install subscription-tracker-ai-mcp
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Run standalone
|
|
20
|
+
python server.py
|
|
21
|
+
|
|
22
|
+
# Or via MCP
|
|
23
|
+
mcp install subscription-tracker-ai-mcp
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Tools
|
|
27
|
+
|
|
28
|
+
### `add_subscription`
|
|
29
|
+
Add a subscription to track. Cost in USD/month. Billing cycle: monthly, yearly, quarterly.
|
|
30
|
+
|
|
31
|
+
**Parameters:**
|
|
32
|
+
- `name` (str)
|
|
33
|
+
- `cost_monthly` (float)
|
|
34
|
+
- `billing_cycle` (str)
|
|
35
|
+
- `renewal_date` (str)
|
|
36
|
+
- `category` (str)
|
|
37
|
+
|
|
38
|
+
### `get_total_spend`
|
|
39
|
+
Calculate total subscription spend. Period: monthly, yearly, daily.
|
|
40
|
+
|
|
41
|
+
**Parameters:**
|
|
42
|
+
- `period` (str)
|
|
43
|
+
|
|
44
|
+
### `list_subscriptions`
|
|
45
|
+
List all tracked subscriptions. Sort by: cost, name, category, date.
|
|
46
|
+
|
|
47
|
+
**Parameters:**
|
|
48
|
+
- `active_only` (bool)
|
|
49
|
+
- `sort_by` (str)
|
|
50
|
+
|
|
51
|
+
### `find_duplicates`
|
|
52
|
+
Find potentially duplicate or overlapping subscriptions in the same category.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## Authentication
|
|
56
|
+
|
|
57
|
+
Free tier: 15 calls/day. Upgrade at [meok.ai/pricing](https://meok.ai/pricing) for unlimited access.
|
|
58
|
+
|
|
59
|
+
## Links
|
|
60
|
+
|
|
61
|
+
- **Website**: [meok.ai](https://meok.ai)
|
|
62
|
+
- **GitHub**: [CSOAI-ORG/subscription-tracker-ai-mcp](https://github.com/CSOAI-ORG/subscription-tracker-ai-mcp)
|
|
63
|
+
- **PyPI**: [pypi.org/project/subscription-tracker-ai-mcp](https://pypi.org/project/subscription-tracker-ai-mcp/)
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
MIT — MEOK AI Labs
|
|
68
|
+
|
|
69
|
+
<!-- meok-moat-footer-v1 -->
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Pairs with MEOK Governance Suite
|
|
73
|
+
|
|
74
|
+
Build something that touches users? You need compliance. MEOK ships 38 governance MCPs that drop in alongside this tool — EU AI Act, DORA, NIS2, CRA, GDPR, ISO 42001, FDA SaMD, MDR, Basel, MiFID II, MiCA, COPPA, and more.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# One-shot install of the governance pack
|
|
78
|
+
npx meok-setup --pack governance
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Free tier: 10 calls/day per MCP. Pro tier (£79/mo): unlimited + cryptographically signed compliance attestations your auditor verifies independently.
|
|
82
|
+
|
|
83
|
+
→ Full catalogue: [councilof.ai/catalogue](https://councilof.ai/catalogue)
|
|
84
|
+
→ MEOK AI Labs: [meok.ai](https://meok.ai)
|
|
85
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
| ------- | ------------------ |
|
|
7
|
+
| 1.0.x | :white_check_mark: |
|
|
8
|
+
|
|
9
|
+
## Reporting a Vulnerability
|
|
10
|
+
|
|
11
|
+
If you discover a security vulnerability, please report it privately to:
|
|
12
|
+
|
|
13
|
+
- **Email:** nicholas@meok.ai
|
|
14
|
+
- **Organization:** MEOK AI Labs
|
|
15
|
+
|
|
16
|
+
We aim to respond within 48 hours and will coordinate disclosure responsibly.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "subscription-tracker-ai-mcp",
|
|
3
|
+
"description": "MEOK AI Labs \u2014 subscription-tracker-ai-mcp",
|
|
4
|
+
"vendor": "MEOK AI Labs",
|
|
5
|
+
"homepage": "https://meok.ai",
|
|
6
|
+
"repository": "https://github.com/CSOAI-ORG/subscription-tracker-ai-mcp",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"runtime": "python",
|
|
9
|
+
"entryPoint": "mcp-wrapper.py"
|
|
10
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# subscription-tracker-ai-mcp
|
|
2
|
+
# > By [MEOK AI Labs](https://meok.ai) — Track SaaS subscriptions, renewal dates, spending, and find duplicate services. By MEOK AI Labs.
|
|
3
|
+
|
|
4
|
+
## Install
|
|
5
|
+
```bash
|
|
6
|
+
pip install subscription-tracker-ai-mcp
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Auth & Rate Limits
|
|
10
|
+
- Free tier: 10 calls/day. No API key required.
|
|
11
|
+
- Pro tier (£79/mo): unlimited + signed attestations.
|
|
12
|
+
- Enterprise (£1,499/mo): white-label.
|
|
13
|
+
|
|
14
|
+
## Tools
|
|
15
|
+
|
|
16
|
+
### `add_subscription`
|
|
17
|
+
Add a subscription to track. Cost in USD/month. Billing cycle: monthly, yearly, quarterly.
|
|
18
|
+
|
|
19
|
+
### `get_total_spend`
|
|
20
|
+
Calculate total subscription spend. Period: monthly, yearly, daily.
|
|
21
|
+
|
|
22
|
+
### `list_subscriptions`
|
|
23
|
+
List all tracked subscriptions. Sort by: cost, name, category, date.
|
|
24
|
+
|
|
25
|
+
### `find_duplicates`
|
|
26
|
+
Find potentially duplicate or overlapping subscriptions in the same category.
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## Maintainer
|
|
30
|
+
MEOK AI Labs · hello@meok.ai · https://meok.ai · MIT licensed
|
|
31
|
+
|
|
32
|
+
## Pairs with
|
|
33
|
+
Governance moat: pair this tool with any of MEOK's 38 governance MCPs (EU AI Act, DORA, NIS2, CRA, GDPR, ISO 42001, etc.) for full compliance coverage.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""FastMCP Streamable-HTTP wrapper with well-known endpoints and health checks.
|
|
3
|
+
|
|
4
|
+
Usage:
|
|
5
|
+
python /path/to/mcp-streamable-http-wrapper.py
|
|
6
|
+
|
|
7
|
+
This imports `mcp` from `server.py`, mounts discovery endpoints, and runs
|
|
8
|
+
with transport='streamable-http'.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import json
|
|
12
|
+
import os
|
|
13
|
+
import sys
|
|
14
|
+
|
|
15
|
+
sys.path.insert(0, os.path.expanduser("~/clawd/meok-labs-engine/shared"))
|
|
16
|
+
sys.path.insert(0, os.getcwd())
|
|
17
|
+
|
|
18
|
+
from starlette.requests import Request
|
|
19
|
+
from starlette.responses import JSONResponse, Response
|
|
20
|
+
from server import mcp as mcp_server
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
SERVICE_NAME = os.path.basename(os.getcwd())
|
|
24
|
+
REPO_URL = f"https://github.com/CSOAI-ORG/{SERVICE_NAME}"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@mcp_server.custom_route("/.well-known/mcp/server-card.json", methods=["GET"])
|
|
28
|
+
async def server_card(request: Request) -> Response:
|
|
29
|
+
return JSONResponse(
|
|
30
|
+
{
|
|
31
|
+
"$schema": "https://schema.smithery.ai/server-card.json",
|
|
32
|
+
"version": "1.0.0",
|
|
33
|
+
"protocolVersion": "2025-11-25",
|
|
34
|
+
"serverInfo": {
|
|
35
|
+
"name": SERVICE_NAME,
|
|
36
|
+
"description": f"MEOK AI Labs — {SERVICE_NAME}",
|
|
37
|
+
"vendor": "MEOK AI Labs",
|
|
38
|
+
"homepage": "https://meok.ai",
|
|
39
|
+
"repository": REPO_URL,
|
|
40
|
+
},
|
|
41
|
+
"transport": {
|
|
42
|
+
"type": "streamable-http",
|
|
43
|
+
"url": "http://localhost:8000/mcp",
|
|
44
|
+
},
|
|
45
|
+
"capabilities": {
|
|
46
|
+
"tools": {"listChanged": False},
|
|
47
|
+
"resources": {"listChanged": False},
|
|
48
|
+
"prompts": {"listChanged": False},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
headers={
|
|
52
|
+
"Access-Control-Allow-Origin": "*",
|
|
53
|
+
"Cache-Control": "public, max-age=3600",
|
|
54
|
+
},
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@mcp_server.custom_route("/.well-known/mcp", methods=["GET"])
|
|
59
|
+
async def mcp_manifest(request: Request) -> Response:
|
|
60
|
+
return JSONResponse(
|
|
61
|
+
{
|
|
62
|
+
"mcp_version": "2025-11-25",
|
|
63
|
+
"endpoints": [
|
|
64
|
+
{
|
|
65
|
+
"type": "streamable-http",
|
|
66
|
+
"path": "/mcp",
|
|
67
|
+
"url": "http://localhost:8000/mcp",
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
headers={
|
|
72
|
+
"Access-Control-Allow-Origin": "*",
|
|
73
|
+
"Cache-Control": "public, max-age=3600",
|
|
74
|
+
},
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
@mcp_server.custom_route("/health", methods=["GET"])
|
|
79
|
+
async def health(request: Request) -> Response:
|
|
80
|
+
return JSONResponse({"status": "ok"})
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
if __name__ == "__main__":
|
|
84
|
+
mcp_server.settings.host = "0.0.0.0"
|
|
85
|
+
mcp_server.run(transport="streamable-http")
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "subscription-tracker-ai-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for subscription tracker ai. Features add subscription, get total spend, list subscriptions. From MEOK AI Labs.",
|
|
5
|
+
"main": "server.py",
|
|
6
|
+
"mcp": {
|
|
7
|
+
"name": "subscription tracker",
|
|
8
|
+
"vendor": "MEOK AI Labs",
|
|
9
|
+
"homepage": "https://meok.ai",
|
|
10
|
+
"repository": "https://github.com/CSOAI-ORG/subscription-tracker-ai-mcp",
|
|
11
|
+
"runtime": "python",
|
|
12
|
+
"tags": [
|
|
13
|
+
"mcp",
|
|
14
|
+
"mcp-server",
|
|
15
|
+
"meok-ai-labs",
|
|
16
|
+
"ai-tools"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"mcp",
|
|
21
|
+
"mcp-server",
|
|
22
|
+
"meok-ai-labs"
|
|
23
|
+
],
|
|
24
|
+
"author": "MEOK AI Labs <nicholas@meok.ai>",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/CSOAI-ORG/subscription-tracker-ai-mcp"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
[project]
|
|
5
|
+
name = "subscription-tracker-ai-mcp"
|
|
6
|
+
version = "1.0.2"
|
|
7
|
+
description = "MCP server for subscription tracker ai. Features add subscription, get total spend, list subscriptions. From MEOK AI Labs."
|
|
8
|
+
license = {file = "LICENSE"}
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
authors = [{name = "MEOK AI Labs", email = "nicholas@meok.ai"}]
|
|
11
|
+
dependencies = ["mcp>=1.0.0"]
|
|
12
|
+
keywords = ["mcp", "ai", "meok", "subscription", "tracker"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"License :: OSI Approved :: MIT License",
|
|
16
|
+
"Operating System :: OS Independent",
|
|
17
|
+
"Topic :: Software Development :: Libraries",
|
|
18
|
+
]
|
|
19
|
+
[project.urls]
|
|
20
|
+
Homepage = "https://meok.ai"
|
|
21
|
+
Repository = "https://github.com/CSOAI-ORG/subscription-tracker-ai-mcp"
|
|
22
|
+
[tool.hatch.build.targets.wheel]
|
|
23
|
+
packages = ["."]
|
|
24
|
+
only-include = ["server.py"]
|
|
25
|
+
|
|
26
|
+
[project.scripts]
|
|
27
|
+
subscription_tracker_ai_mcp = "server:main"
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Subscription Tracker AI — track SaaS subscriptions, costs, renewals, and find duplicates. MEOK AI Labs."""
|
|
3
|
+
import sys, os
|
|
4
|
+
from auth_middleware import check_access
|
|
5
|
+
from persistence import ServerStore
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
from datetime import datetime, timezone
|
|
9
|
+
from collections import defaultdict
|
|
10
|
+
from mcp.server.fastmcp import FastMCP
|
|
11
|
+
|
|
12
|
+
_store = ServerStore("subscription-tracker-ai")
|
|
13
|
+
|
|
14
|
+
FREE_DAILY_LIMIT = 15
|
|
15
|
+
_usage = defaultdict(list)
|
|
16
|
+
def _rl(c="anon"):
|
|
17
|
+
now = datetime.now(timezone.utc)
|
|
18
|
+
_usage[c] = [t for t in _usage[c] if (now-t).total_seconds() < 86400]
|
|
19
|
+
if len(_usage[c]) >= FREE_DAILY_LIMIT: return json.dumps({"error": f"Limit {FREE_DAILY_LIMIT}/day"})
|
|
20
|
+
_usage[c].append(now); return None
|
|
21
|
+
|
|
22
|
+
# Category mapping for duplicate detection
|
|
23
|
+
_CATEGORIES = {
|
|
24
|
+
"streaming": ["netflix", "hulu", "disney", "hbo", "paramount", "peacock", "apple tv", "prime video", "crunchyroll"],
|
|
25
|
+
"music": ["spotify", "apple music", "tidal", "youtube music", "amazon music", "deezer"],
|
|
26
|
+
"cloud_storage": ["dropbox", "google drive", "onedrive", "icloud", "box"],
|
|
27
|
+
"productivity": ["notion", "todoist", "asana", "monday", "clickup", "trello"],
|
|
28
|
+
"ai_tools": ["chatgpt", "claude", "midjourney", "copilot", "jasper", "grammarly"],
|
|
29
|
+
"design": ["figma", "canva", "adobe", "sketch", "affinity"],
|
|
30
|
+
"dev_tools": ["github", "gitlab", "vercel", "netlify", "railway", "heroku"],
|
|
31
|
+
"vpn": ["nordvpn", "expressvpn", "surfshark", "protonvpn", "mullvad"],
|
|
32
|
+
"fitness": ["peloton", "strava", "fitbit", "myfitnesspal", "headspace", "calm"],
|
|
33
|
+
"news": ["nyt", "washington post", "wsj", "economist", "substack", "medium"],
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
mcp = FastMCP("subscription-tracker-ai", instructions="Track SaaS subscriptions, renewal dates, spending, and find duplicate services. By MEOK AI Labs.")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@mcp.tool()
|
|
40
|
+
def add_subscription(name: str, cost_monthly: float, billing_cycle: str = "monthly", renewal_date: str = "", category: str = "", api_key: str = "") -> str:
|
|
41
|
+
"""Add a subscription to track. Cost in USD/month. Billing cycle: monthly, yearly, quarterly."""
|
|
42
|
+
allowed, msg, tier = check_access(api_key)
|
|
43
|
+
if not allowed:
|
|
44
|
+
return json.dumps({"error": msg, "upgrade_url": "https://meok.ai/pricing"})
|
|
45
|
+
if err := _rl(): return err
|
|
46
|
+
if cost_monthly < 0:
|
|
47
|
+
return json.dumps({"error": "Cost cannot be negative"})
|
|
48
|
+
billing_cycle = billing_cycle.lower()
|
|
49
|
+
if billing_cycle not in ("monthly", "yearly", "quarterly"):
|
|
50
|
+
return json.dumps({"error": "Billing cycle must be monthly, yearly, or quarterly"})
|
|
51
|
+
# Auto-detect category if not provided
|
|
52
|
+
if not category:
|
|
53
|
+
name_lower = name.lower()
|
|
54
|
+
for cat, services in _CATEGORIES.items():
|
|
55
|
+
if any(svc in name_lower for svc in services):
|
|
56
|
+
category = cat
|
|
57
|
+
break
|
|
58
|
+
if not category:
|
|
59
|
+
category = "other"
|
|
60
|
+
# Calculate effective monthly cost
|
|
61
|
+
if billing_cycle == "yearly":
|
|
62
|
+
effective_monthly = cost_monthly # user provides monthly equivalent
|
|
63
|
+
elif billing_cycle == "quarterly":
|
|
64
|
+
effective_monthly = cost_monthly
|
|
65
|
+
else:
|
|
66
|
+
effective_monthly = cost_monthly
|
|
67
|
+
sub = {
|
|
68
|
+
"id": _store.list_length("subscriptions") + 1,
|
|
69
|
+
"name": name,
|
|
70
|
+
"cost_monthly": round(cost_monthly, 2),
|
|
71
|
+
"billing_cycle": billing_cycle,
|
|
72
|
+
"category": category,
|
|
73
|
+
"renewal_date": renewal_date or "not set",
|
|
74
|
+
"added_at": datetime.now(timezone.utc).isoformat(),
|
|
75
|
+
"active": True,
|
|
76
|
+
}
|
|
77
|
+
_store.append("subscriptions", sub)
|
|
78
|
+
all_subs = _store.list("subscriptions")
|
|
79
|
+
total_monthly = sum(s["cost_monthly"] for s in all_subs if s["active"])
|
|
80
|
+
return json.dumps({
|
|
81
|
+
"added": sub,
|
|
82
|
+
"total_subscriptions": sum(1 for s in _subscriptions if s["active"]),
|
|
83
|
+
"total_monthly_spend": round(total_monthly, 2),
|
|
84
|
+
}, indent=2)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
@mcp.tool()
|
|
88
|
+
def get_total_spend(period: str = "monthly", api_key: str = "") -> str:
|
|
89
|
+
"""Calculate total subscription spend. Period: monthly, yearly, daily."""
|
|
90
|
+
allowed, msg, tier = check_access(api_key)
|
|
91
|
+
if not allowed:
|
|
92
|
+
return json.dumps({"error": msg, "upgrade_url": "https://meok.ai/pricing"})
|
|
93
|
+
if err := _rl(): return err
|
|
94
|
+
active = [s for s in _store.list("subscriptions") if s["active"]]
|
|
95
|
+
if not active:
|
|
96
|
+
return json.dumps({"message": "No active subscriptions tracked yet.", "total": 0})
|
|
97
|
+
monthly_total = sum(s["cost_monthly"] for s in active)
|
|
98
|
+
period = period.lower()
|
|
99
|
+
multipliers = {"daily": 1 / 30.44, "monthly": 1, "yearly": 12}
|
|
100
|
+
if period not in multipliers:
|
|
101
|
+
return json.dumps({"error": "Period must be daily, monthly, or yearly"})
|
|
102
|
+
amount = monthly_total * multipliers[period]
|
|
103
|
+
# Category breakdown
|
|
104
|
+
by_category: dict[str, float] = defaultdict(float)
|
|
105
|
+
for s in active:
|
|
106
|
+
by_category[s["category"]] += s["cost_monthly"] * multipliers[period]
|
|
107
|
+
sorted_cats = sorted(by_category.items(), key=lambda x: x[1], reverse=True)
|
|
108
|
+
# Most expensive subscription
|
|
109
|
+
most_expensive = max(active, key=lambda s: s["cost_monthly"])
|
|
110
|
+
return json.dumps({
|
|
111
|
+
"period": period,
|
|
112
|
+
"total_spend": round(amount, 2),
|
|
113
|
+
"currency": "USD",
|
|
114
|
+
"active_subscriptions": len(active),
|
|
115
|
+
"by_category": {k: round(v, 2) for k, v in sorted_cats},
|
|
116
|
+
"most_expensive": {"name": most_expensive["name"], "cost_monthly": most_expensive["cost_monthly"]},
|
|
117
|
+
"average_per_subscription": round(amount / len(active), 2),
|
|
118
|
+
}, indent=2)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
@mcp.tool()
|
|
122
|
+
def list_subscriptions(active_only: bool = True, sort_by: str = "cost", api_key: str = "") -> str:
|
|
123
|
+
"""List all tracked subscriptions. Sort by: cost, name, category, date."""
|
|
124
|
+
allowed, msg, tier = check_access(api_key)
|
|
125
|
+
if not allowed:
|
|
126
|
+
return json.dumps({"error": msg, "upgrade_url": "https://meok.ai/pricing"})
|
|
127
|
+
if err := _rl(): return err
|
|
128
|
+
all_subs = _store.list("subscriptions")
|
|
129
|
+
subs = all_subs if not active_only else [s for s in all_subs if s["active"]]
|
|
130
|
+
if not subs:
|
|
131
|
+
return json.dumps({"message": "No subscriptions found.", "subscriptions": []})
|
|
132
|
+
sort_keys = {
|
|
133
|
+
"cost": lambda s: s["cost_monthly"],
|
|
134
|
+
"name": lambda s: s["name"].lower(),
|
|
135
|
+
"category": lambda s: s["category"],
|
|
136
|
+
"date": lambda s: s["added_at"],
|
|
137
|
+
}
|
|
138
|
+
sort_fn = sort_keys.get(sort_by.lower(), sort_keys["cost"])
|
|
139
|
+
reverse = sort_by.lower() == "cost"
|
|
140
|
+
sorted_subs = sorted(subs, key=sort_fn, reverse=reverse)
|
|
141
|
+
total = sum(s["cost_monthly"] for s in sorted_subs)
|
|
142
|
+
return json.dumps({
|
|
143
|
+
"subscriptions": sorted_subs,
|
|
144
|
+
"count": len(sorted_subs),
|
|
145
|
+
"total_monthly": round(total, 2),
|
|
146
|
+
"total_yearly": round(total * 12, 2),
|
|
147
|
+
"sorted_by": sort_by,
|
|
148
|
+
}, indent=2)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
@mcp.tool()
|
|
152
|
+
def find_duplicates(api_key: str = "") -> str:
|
|
153
|
+
"""Find potentially duplicate or overlapping subscriptions in the same category."""
|
|
154
|
+
allowed, msg, tier = check_access(api_key)
|
|
155
|
+
if not allowed:
|
|
156
|
+
return json.dumps({"error": msg, "upgrade_url": "https://meok.ai/pricing"})
|
|
157
|
+
if err := _rl(): return err
|
|
158
|
+
active = [s for s in _store.list("subscriptions") if s["active"]]
|
|
159
|
+
if len(active) < 2:
|
|
160
|
+
return json.dumps({"message": "Need at least 2 subscriptions to check for duplicates.", "duplicates": []})
|
|
161
|
+
# Group by category
|
|
162
|
+
by_cat: dict[str, list[dict]] = defaultdict(list)
|
|
163
|
+
for s in active:
|
|
164
|
+
by_cat[s["category"]].append(s)
|
|
165
|
+
duplicates = []
|
|
166
|
+
potential_savings = 0.0
|
|
167
|
+
for category, subs in by_cat.items():
|
|
168
|
+
if len(subs) > 1 and category != "other":
|
|
169
|
+
costs = sorted(subs, key=lambda s: s["cost_monthly"])
|
|
170
|
+
savings = sum(s["cost_monthly"] for s in costs[:-1]) # keep the most expensive, save the rest
|
|
171
|
+
potential_savings += savings
|
|
172
|
+
duplicates.append({
|
|
173
|
+
"category": category,
|
|
174
|
+
"services": [{"name": s["name"], "cost_monthly": s["cost_monthly"]} for s in subs],
|
|
175
|
+
"count": len(subs),
|
|
176
|
+
"potential_monthly_savings": round(savings, 2),
|
|
177
|
+
"suggestion": f"You have {len(subs)} {category} services. Consider consolidating to save ${savings:.2f}/month.",
|
|
178
|
+
})
|
|
179
|
+
return json.dumps({
|
|
180
|
+
"duplicates_found": len(duplicates),
|
|
181
|
+
"overlapping_categories": duplicates,
|
|
182
|
+
"total_potential_savings_monthly": round(potential_savings, 2),
|
|
183
|
+
"total_potential_savings_yearly": round(potential_savings * 12, 2),
|
|
184
|
+
"tip": "Review overlapping services and keep only the ones you actively use." if duplicates else "No obvious duplicates found!",
|
|
185
|
+
}, indent=2)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def main():
|
|
189
|
+
mcp.run()
|
|
190
|
+
|
|
191
|
+
if __name__ == '__main__':
|
|
192
|
+
main()
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: subscription-tracker-ai-mcp
|
|
2
|
+
description: MCP server for subscription tracker ai. Features add subscription, get
|
|
3
|
+
total spend, list subscriptions. From MEOK AI Labs.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
tools:
|
|
6
|
+
- name: add_subscription
|
|
7
|
+
description: 'Add a subscription to track. Cost in USD/month. Billing cycle: monthly,
|
|
8
|
+
yearly, quarterly.'
|
|
9
|
+
parameters:
|
|
10
|
+
- name: name
|
|
11
|
+
type: string
|
|
12
|
+
required: true
|
|
13
|
+
- name: cost_monthly
|
|
14
|
+
type: number
|
|
15
|
+
required: true
|
|
16
|
+
- name: billing_cycle
|
|
17
|
+
type: string
|
|
18
|
+
required: false
|
|
19
|
+
- name: renewal_date
|
|
20
|
+
type: string
|
|
21
|
+
required: false
|
|
22
|
+
- name: category
|
|
23
|
+
type: string
|
|
24
|
+
required: false
|
|
25
|
+
- name: get_total_spend
|
|
26
|
+
description: 'Calculate total subscription spend. Period: monthly, yearly, daily.'
|
|
27
|
+
parameters:
|
|
28
|
+
- name: period
|
|
29
|
+
type: string
|
|
30
|
+
required: false
|
|
31
|
+
- name: list_subscriptions
|
|
32
|
+
description: 'List all tracked subscriptions. Sort by: cost, name, category, date.'
|
|
33
|
+
parameters:
|
|
34
|
+
- name: active_only
|
|
35
|
+
type: boolean
|
|
36
|
+
required: false
|
|
37
|
+
- name: sort_by
|
|
38
|
+
type: string
|
|
39
|
+
required: false
|
|
40
|
+
- name: find_duplicates
|
|
41
|
+
description: Find potentially duplicate or overlapping subscriptions in the same
|
|
42
|
+
category.
|
|
43
|
+
parameters: []
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import unittest
|
|
4
|
+
|
|
5
|
+
# Ensure shared auth middleware is available
|
|
6
|
+
sys.path.insert(0, os.path.expanduser("~/clawd/meok-labs-engine/shared"))
|
|
7
|
+
os.chdir(os.path.dirname(os.path.abspath(__file__)) + "/..")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class TestMCPImport(unittest.TestCase):
|
|
11
|
+
def test_import_server(self):
|
|
12
|
+
"""Server module must import without errors."""
|
|
13
|
+
import server # noqa: F401
|
|
14
|
+
|
|
15
|
+
def test_mcp_or_server_object_exists(self):
|
|
16
|
+
"""FastMCP servers export 'mcp'; low-level servers export 'server'."""
|
|
17
|
+
import server as srv
|
|
18
|
+
self.assertTrue(
|
|
19
|
+
hasattr(srv, "mcp") or hasattr(srv, "server"),
|
|
20
|
+
"Expected 'mcp' or 'server' object in server.py",
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class TestAuthMiddleware(unittest.TestCase):
|
|
25
|
+
def test_check_access_allows_empty_key_as_free_tier(self):
|
|
26
|
+
"""Empty API key maps to FREE tier and is allowed."""
|
|
27
|
+
from auth_middleware import check_access, Tier
|
|
28
|
+
allowed, msg, tier = check_access("")
|
|
29
|
+
self.assertTrue(allowed)
|
|
30
|
+
self.assertEqual(tier, Tier.FREE)
|
|
31
|
+
self.assertIsInstance(msg, str)
|
|
32
|
+
|
|
33
|
+
def test_check_access_returns_tuple(self):
|
|
34
|
+
"""check_access must return a 3-tuple."""
|
|
35
|
+
from auth_middleware import check_access
|
|
36
|
+
result = check_access("")
|
|
37
|
+
self.assertIsInstance(result, tuple)
|
|
38
|
+
self.assertEqual(len(result), 3)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class TestHealthEndpoint(unittest.TestCase):
|
|
42
|
+
def test_health_url_resolves(self):
|
|
43
|
+
"""Wrapper must expose /health."""
|
|
44
|
+
import urllib.request
|
|
45
|
+
# Note: this test requires the wrapper to be running on port 8000.
|
|
46
|
+
# It is skipped in CI unless the server is active.
|
|
47
|
+
try:
|
|
48
|
+
resp = urllib.request.urlopen("http://localhost:8000/health", timeout=2)
|
|
49
|
+
self.assertEqual(resp.status, 200)
|
|
50
|
+
except Exception as e:
|
|
51
|
+
self.skipTest(f"Server not running: {e}")
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
if __name__ == "__main__":
|
|
55
|
+
unittest.main()
|