Skip to content

Commit 309e7a3

Browse files
committed
feat: initial implementation of MCPCat analytics SDK
0 parents  commit 309e7a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+5852
-0
lines changed

.claude/settings.local.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(mkdir:*)",
5+
"Bash(find:*)",
6+
"Bash(grep:*)",
7+
"Bash(uv run pytest tests/test_get_unknown_or_stdio_session.py -v)",
8+
"Bash(uv run:*)",
9+
"Bash(rg:*)",
10+
"Bash(/Users/naseemalnaji/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg \"CallToolResult\" --type py -A 3 -B 3)",
11+
"Bash(/Users/naseemalnaji/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg \"from mcp.types import.*CallToolResult\" --type py)",
12+
"Bash(pip show:*)",
13+
"WebFetch(domain:mcpcat.io)"
14+
],
15+
"deny": []
16+
}
17+
}
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: MCP Version Compatibility Testing
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
# Run weekly to catch new MCP versions
10+
- cron: '0 0 * * 0'
11+
workflow_dispatch:
12+
13+
jobs:
14+
discover-versions:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
mcp-versions: ${{ steps.get-versions.outputs.versions }}
18+
19+
steps:
20+
- name: Get available MCP versions
21+
id: get-versions
22+
run: |
23+
# Get all available versions from PyPI
24+
versions=$(pip index versions mcp 2>/dev/null | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | sort -V)
25+
26+
# Filter to versions >= 1.2.0 and get only latest patch version for each minor
27+
declare -A latest_minor
28+
for version in $versions; do
29+
major=$(echo $version | cut -d. -f1)
30+
minor=$(echo $version | cut -d. -f2)
31+
patch=$(echo $version | cut -d. -f3)
32+
33+
# Include if version >= 1.2.0
34+
if [ "$major" -gt 1 ] || ([ "$major" -eq 1 ] && [ "$minor" -ge 2 ]); then
35+
minor_key="$major.$minor"
36+
latest_minor[$minor_key]="$version"
37+
fi
38+
done
39+
40+
# Create JSON array from latest versions
41+
filtered_versions=()
42+
for version in "${latest_minor[@]}"; do
43+
filtered_versions+=("\"$version\"")
44+
done
45+
46+
json_array="[$(IFS=,; echo "${filtered_versions[*]}")]"
47+
echo "Found MCP versions: $json_array"
48+
echo "versions=$json_array" >> $GITHUB_OUTPUT
49+
50+
test-compatibility:
51+
runs-on: ubuntu-latest
52+
needs: discover-versions
53+
strategy:
54+
matrix:
55+
mcp-version: ${{ fromJson(needs.discover-versions.outputs.mcp-versions) }}
56+
fail-fast: false
57+
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- name: Install uv
62+
uses: astral-sh/setup-uv@v4
63+
with:
64+
version: "latest"
65+
66+
- name: Set up Python 3.12
67+
uses: actions/setup-python@v5
68+
with:
69+
python-version: '3.12'
70+
71+
- name: Update pyproject.toml with MCP ${{ matrix.mcp-version }}
72+
run: |
73+
# Replace the whole quoted string, preserving the trailing comma
74+
sed -i -E 's/"mcp==[^"]+"/"mcp==${{ matrix.mcp-version }}"/' pyproject.toml
75+
76+
- name: Install dependencies with MCP ${{ matrix.mcp-version }}
77+
run: |
78+
uv sync --extra dev
79+
80+
- name: Run full test suite with MCP ${{ matrix.mcp-version }}
81+
run: |
82+
echo "Running full test suite with MCP version ${{ matrix.mcp-version }}"
83+
uv run pytest tests/ -v
84+
85+
report-compatibility:
86+
runs-on: ubuntu-latest
87+
needs: [discover-versions, test-compatibility]
88+
if: always()
89+
90+
steps:
91+
- uses: actions/checkout@v4
92+
93+
- name: Print compatibility report
94+
run: |
95+
echo "=========================================="
96+
echo " MCP VERSION COMPATIBILITY REPORT "
97+
echo "=========================================="
98+
echo ""
99+
echo "This report shows the compatibility status of MCPCat with different MCP versions."
100+
echo ""
101+
echo "Generated on: $(date)"
102+
echo ""
103+
echo "📋 TESTED VERSIONS"
104+
echo "─────────────────────────────────────────"
105+
echo "MCP versions tested: ${{ needs.discover-versions.outputs.mcp-versions }}"
106+
echo "Python version: 3.12"
107+
echo ""
108+
echo "🧪 TEST COVERAGE"
109+
echo "─────────────────────────────────────────"
110+
echo "✓ FastMCP server compatibility"
111+
echo "✓ Low-level Server compatibility"
112+
echo "✓ Both implementations tested with is_compatible_server function"
113+
echo ""
114+
echo "📊 RESULTS"
115+
echo "─────────────────────────────────────────"
116+
echo "Check the individual test job results above for detailed compatibility status."
117+
echo "Each MCP version was tested in a separate matrix job."
118+
echo ""
119+
echo "=========================================="

.gitignore

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.nox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
*.py,cover
48+
.hypothesis/
49+
.pytest_cache/
50+
cover/
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
local_settings.py
59+
db.sqlite3
60+
db.sqlite3-journal
61+
62+
# Flask stuff:
63+
instance/
64+
.webassets-cache
65+
66+
# Scrapy stuff:
67+
.scrapy
68+
69+
# Sphinx documentation
70+
docs/_build/
71+
72+
# PyBuilder
73+
.pybuilder/
74+
target/
75+
76+
# Jupyter Notebook
77+
.ipynb_checkpoints
78+
79+
# IPython
80+
profile_default/
81+
ipython_config.py
82+
83+
# pyenv
84+
.python-version
85+
86+
# pipenv
87+
Pipfile.lock
88+
89+
# pdm
90+
.pdm.toml
91+
.pdm-python
92+
93+
# PEP 582
94+
__pypackages__/
95+
96+
# Celery stuff
97+
celerybeat-schedule
98+
celerybeat.pid
99+
100+
# SageMath parsed files
101+
*.sage.py
102+
103+
# Environments
104+
.env
105+
.venv
106+
env/
107+
venv/
108+
ENV/
109+
env.bak/
110+
venv.bak/
111+
112+
# Spyder project settings
113+
.spyderproject
114+
.spyproject
115+
116+
# Rope project settings
117+
.ropeproject
118+
119+
# mkdocs documentation
120+
/site
121+
122+
# mypy
123+
.mypy_cache/
124+
.dmypy.json
125+
dmypy.json
126+
127+
# Pyre type checker
128+
.pyre/
129+
130+
# pytype static type analyzer
131+
.pytype/
132+
133+
# Cython debug symbols
134+
cython_debug/
135+
136+
# PyCharm
137+
.idea/
138+
139+
# VSCode
140+
.vscode/
141+
142+
# macOS
143+
.DS_Store
144+
145+
# uv
146+
.uv/
147+
uv.lock
148+
CLAUDE.md
149+
.claude/

CLAUDE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
- Always run with `uv`
2+
3+
# MCPcat Package Publishing Info
4+
5+
## Package Details
6+
- Package name: `mcpcat`
7+
- Current version: `0.1.0b1` (pre-alpha)
8+
- PyPI URL: https://pypi.org/project/mcpcat/
9+
- Author: MCPCat
10+
11+
- License: MIT
12+
- GitHub: https://github.com/MCPCat/mcpcat-python-sdk
13+
14+
## Publishing Commands
15+
```bash
16+
# Build the package
17+
uv build
18+
19+
# Publish to PyPI
20+
export UV_PUBLISH_TOKEN="your-pypi-token"
21+
uv publish
22+
```
23+
24+
## Version Conventions
25+
- Using beta versions (e.g., 0.1.0b1, 0.1.0b2) for pre-release
26+
- TypeScript SDK uses: 0.1.0-beta.1 format
27+
- Python uses: 0.1.0b1 format (PEP 440)
28+
29+
## Important Notes
30+
- PyPI packages are immutable - cannot undo publishes
31+
- Must increment version for each new release
32+
- Package supports Python >=3.10

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 MCPCat
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 commit comments

Comments
 (0)