bridgemcp-py 0.2.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.
Files changed (52) hide show
  1. bridgemcp_py-0.2.0/.claude/settings.local.json +29 -0
  2. bridgemcp_py-0.2.0/.github/ISSUE_TEMPLATE/bug_report.md +48 -0
  3. bridgemcp_py-0.2.0/.github/ISSUE_TEMPLATE/feature_request.md +39 -0
  4. bridgemcp_py-0.2.0/.github/ISSUE_TEMPLATE/plugin_request.md +41 -0
  5. bridgemcp_py-0.2.0/.github/PULL_REQUEST_TEMPLATE.md +30 -0
  6. bridgemcp_py-0.2.0/.github/workflows/tests.yml +37 -0
  7. bridgemcp_py-0.2.0/.gitignore +46 -0
  8. bridgemcp_py-0.2.0/ARCHITECTURE.md +450 -0
  9. bridgemcp_py-0.2.0/CHANGELOG.md +107 -0
  10. bridgemcp_py-0.2.0/CODE_OF_CONDUCT.md +133 -0
  11. bridgemcp_py-0.2.0/CONTRIBUTING.md +53 -0
  12. bridgemcp_py-0.2.0/GOVERNANCE.md +156 -0
  13. bridgemcp_py-0.2.0/LICENSE +21 -0
  14. bridgemcp_py-0.2.0/PKG-INFO +284 -0
  15. bridgemcp_py-0.2.0/README.md +252 -0
  16. bridgemcp_py-0.2.0/SECURITY.md +56 -0
  17. bridgemcp_py-0.2.0/bridgemcp/__init__.py +10 -0
  18. bridgemcp_py-0.2.0/bridgemcp/adapters/__init__.py +3 -0
  19. bridgemcp_py-0.2.0/bridgemcp/adapters/mcp.py +303 -0
  20. bridgemcp_py-0.2.0/bridgemcp/application.py +711 -0
  21. bridgemcp_py-0.2.0/bridgemcp/config/__init__.py +10 -0
  22. bridgemcp_py-0.2.0/bridgemcp/config/models.py +32 -0
  23. bridgemcp_py-0.2.0/bridgemcp/exceptions.py +211 -0
  24. bridgemcp_py-0.2.0/bridgemcp/execution.py +108 -0
  25. bridgemcp_py-0.2.0/bridgemcp/middleware.py +88 -0
  26. bridgemcp_py-0.2.0/bridgemcp/plugin.py +128 -0
  27. bridgemcp_py-0.2.0/bridgemcp/prompts/__init__.py +22 -0
  28. bridgemcp_py-0.2.0/bridgemcp/prompts/normalize.py +61 -0
  29. bridgemcp_py-0.2.0/bridgemcp/prompts/registry.py +206 -0
  30. bridgemcp_py-0.2.0/bridgemcp/py.typed +0 -0
  31. bridgemcp_py-0.2.0/bridgemcp/resources/__init__.py +14 -0
  32. bridgemcp_py-0.2.0/bridgemcp/resources/normalize.py +69 -0
  33. bridgemcp_py-0.2.0/bridgemcp/resources/registry.py +144 -0
  34. bridgemcp_py-0.2.0/bridgemcp/tools/__init__.py +13 -0
  35. bridgemcp_py-0.2.0/bridgemcp/tools/registry.py +125 -0
  36. bridgemcp_py-0.2.0/examples/hello_world/README.md +44 -0
  37. bridgemcp_py-0.2.0/examples/hello_world/server.py +58 -0
  38. bridgemcp_py-0.2.0/pyproject.toml +69 -0
  39. bridgemcp_py-0.2.0/tests/test_adapter.py +620 -0
  40. bridgemcp_py-0.2.0/tests/test_application.py +130 -0
  41. bridgemcp_py-0.2.0/tests/test_config.py +43 -0
  42. bridgemcp_py-0.2.0/tests/test_exceptions.py +257 -0
  43. bridgemcp_py-0.2.0/tests/test_execution.py +317 -0
  44. bridgemcp_py-0.2.0/tests/test_invocation.py +292 -0
  45. bridgemcp_py-0.2.0/tests/test_lifecycle.py +399 -0
  46. bridgemcp_py-0.2.0/tests/test_middleware.py +761 -0
  47. bridgemcp_py-0.2.0/tests/test_plugin.py +689 -0
  48. bridgemcp_py-0.2.0/tests/test_prompt_invocation.py +447 -0
  49. bridgemcp_py-0.2.0/tests/test_prompt_registry.py +518 -0
  50. bridgemcp_py-0.2.0/tests/test_resource_invocation.py +444 -0
  51. bridgemcp_py-0.2.0/tests/test_resource_registry.py +470 -0
  52. bridgemcp_py-0.2.0/tests/test_tool_registry.py +323 -0
@@ -0,0 +1,29 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "PowerShell(python \"C:\\\\Users\\\\Admin\\\\AppData\\\\Local\\\\Temp\\\\claude\\\\E--Claude-Code-universal-mcp-server\\\\3e983b44-1bca-495e-9c1b-ba11f587b00a\\\\scratchpad\\\\mcp_handshake_test.py\" 2>&1)",
5
+ "PowerShell(python -c \"import bridgemcp; print\\(bridgemcp.__version__\\)\")",
6
+ "PowerShell(pip install ruff black -q)",
7
+ "PowerShell(python -m ruff check \"E:\\\\Claude Code\\\\universal-mcp-server\\\\bridgemcp\" \"E:\\\\Claude Code\\\\universal-mcp-server\\\\tests\" 2>&1)",
8
+ "PowerShell(pip install ruff black --quiet)",
9
+ "PowerShell(ruff --version)",
10
+ "PowerShell(black --version)",
11
+ "PowerShell(pip install ruff black -q 2>&1)",
12
+ "PowerShell(ruff --version 2>&1)",
13
+ "PowerShell(black --version 2>&1)",
14
+ "PowerShell(python -c \"from mcp.server.fastmcp import FastMCP; import inspect; print\\(inspect.getsource\\(FastMCP.resource\\)\\)\" 2>&1)",
15
+ "PowerShell(cd \"E:\\\\Claude Code\\\\universal-mcp-server\"; $env:PYTHONIOENCODING='utf-8'; & \\(Get-Content graphify-out/.graphify_python\\) \"C:\\\\Users\\\\Admin\\\\AppData\\\\Local\\\\Temp\\\\claude\\\\E--Claude-Code-universal-mcp-server\\\\bc06caef-b533-4aa2-acba-5276e97a2f94\\\\scratchpad\\\\full_graphify.py\" 2>&1 | Select-Object -Last 10)",
16
+ "PowerShell(cd \"E:\\\\Claude Code\\\\universal-mcp-server\"; $env:PYTHONIOENCODING='utf-8'; & \\(Get-Content graphify-out/.graphify_python\\) \"C:\\\\Users\\\\Admin\\\\AppData\\\\Local\\\\Temp\\\\claude\\\\E--Claude-Code-universal-mcp-server\\\\bc06caef-b533-4aa2-acba-5276e97a2f94\\\\scratchpad\\\\full_graphify.py\" 2>&1 | Select-Object -Last 8)",
17
+ "PowerShell(cd \"E:\\\\Claude Code\\\\universal-mcp-server\"; Remove-Item graphify-out\\\\graph.json -ErrorAction SilentlyContinue; $env:PYTHONIOENCODING='utf-8'; & \\(Get-Content graphify-out/.graphify_python\\) \"C:\\\\Users\\\\Admin\\\\AppData\\\\Local\\\\Temp\\\\claude\\\\E--Claude-Code-universal-mcp-server\\\\bc06caef-b533-4aa2-acba-5276e97a2f94\\\\scratchpad\\\\full_graphify.py\" 2>&1 | Select-Object -Last 8)",
18
+ "PowerShell(cd \"E:\\\\Claude Code\\\\universal-mcp-server\"; $env:PYTHONIOENCODING='utf-8'; & \\(Get-Content graphify-out/.graphify_python\\) \"C:\\\\Users\\\\Admin\\\\AppData\\\\Local\\\\Temp\\\\claude\\\\E--Claude-Code-universal-mcp-server\\\\bc06caef-b533-4aa2-acba-5276e97a2f94\\\\scratchpad\\\\full_graphify.py\" 2>&1 | Select-Object -First 5)",
19
+ "PowerShell(cd \"E:\\\\Claude Code\\\\universal-mcp-server\"; Remove-Item -Recurse -Force graphify-out -ErrorAction SilentlyContinue; $env:PYTHONIOENCODING='utf-8'; & \\(Get-Content \"C:\\\\Users\\\\Admin\\\\AppData\\\\Local\\\\Temp\\\\claude\\\\E--Claude-Code-universal-mcp-server\\\\bc06caef-b533-4aa2-acba-5276e97a2f94\\\\scratchpad\\\\.graphify_python\"\\) \"C:\\\\Users\\\\Admin\\\\AppData\\\\Local\\\\Temp\\\\claude\\\\E--Claude-Code-universal-mcp-server\\\\bc06caef-b533-4aa2-acba-5276e97a2f94\\\\scratchpad\\\\full_graphify.py\" 2>&1 | Select-Object -Last 8)",
20
+ "PowerShell($root = \"E:\\\\Claude Code\\\\universal-mcp-server\"; Get-ChildItem $root -Force | Select-Object Mode, Name | Format-Table -AutoSize; Write-Output \"---\"; Test-Path \\(Join-Path $root \".git\"\\))",
21
+ "PowerShell(robocopy \"E:\\\\Claude Code\\\\universal-mcp-server\" \"E:\\\\Claude Code\\\\BridgeMCP\" /E /COPYALL /NFL /NDL /NJH /NJS; Write-Output \"Exit: $LASTEXITCODE\")",
22
+ "PowerShell(robocopy \"E:\\\\Claude Code\\\\universal-mcp-server\" \"E:\\\\Claude Code\\\\BridgeMCP\" /E /NFL /NDL /NJH /NJS; Write-Output \"Exit: $LASTEXITCODE\")",
23
+ "Bash(Test-Path \"E:\\\\Claude Code\\\\BridgeMCP\\\\graphify-out\\\\graph.json\")",
24
+ "Bash(git push *)",
25
+ "Bash(git add *)",
26
+ "Bash(git commit -m ' *)"
27
+ ]
28
+ }
29
+ }
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report something that is broken or behaving unexpectedly
4
+ title: '[Bug] '
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Environment
10
+
11
+ - **BridgeMCP version**: <!-- e.g. 0.2.0 — run `python -c "import bridgemcp; print(bridgemcp.__version__)"` -->
12
+ - **Python version**: <!-- e.g. 3.12.3 -->
13
+ - **OS**: <!-- e.g. Ubuntu 22.04, macOS 14, Windows 11 -->
14
+ - **Installation**: <!-- e.g. `pip install bridgemcp-py[mcp]` or editable install -->
15
+
16
+ ## What happened?
17
+
18
+ <!-- A clear description of the bug. -->
19
+
20
+ ## What did you expect to happen?
21
+
22
+ <!-- A clear description of what you expected. -->
23
+
24
+ ## Minimal reproducer
25
+
26
+ <!-- The smallest possible code that reproduces the bug. -->
27
+
28
+ ```python
29
+ from bridgemcp import BridgeMCP
30
+
31
+ app = BridgeMCP(name="repro")
32
+
33
+ # ...
34
+
35
+ ```
36
+
37
+ ## Full traceback
38
+
39
+ <!-- Paste the full error output here, if applicable. -->
40
+
41
+ ```
42
+ Traceback (most recent call last):
43
+ ...
44
+ ```
45
+
46
+ ## Additional context
47
+
48
+ <!-- Anything else that might help — e.g. is this inside an async framework, behind a proxy, etc. -->
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: Feature request
3
+ about: Propose an addition or improvement to BridgeMCP
4
+ title: '[Feature] '
5
+ labels: enhancement
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Summary
10
+
11
+ <!-- One sentence describing what you want. -->
12
+
13
+ ## Motivation
14
+
15
+ <!-- Describe the production use case that requires this feature.
16
+ "It would be nice to have" is not sufficient — please describe a real scenario. -->
17
+
18
+ ## Why can't this be a plugin?
19
+
20
+ <!-- BridgeMCP's core is intentionally small. Most features belong in plugins.
21
+ Please explain why this cannot be implemented using the middleware or plugin API. -->
22
+
23
+ ## Proposed API
24
+
25
+ <!-- If applicable, sketch what the public API would look like. -->
26
+
27
+ ```python
28
+ # Example usage of the proposed feature
29
+
30
+ ```
31
+
32
+ ## Breaking changes
33
+
34
+ <!-- Would this require any changes to the existing public API?
35
+ If so, describe what would break and how users would migrate. -->
36
+
37
+ ## Alternatives considered
38
+
39
+ <!-- What other approaches did you consider? Why are they insufficient? -->
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: Plugin request
3
+ about: Suggest a new official plugin or request community plugin listing
4
+ title: '[Plugin] '
5
+ labels: plugin
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Plugin name
10
+
11
+ <!-- e.g. bridgemcp-logging, bridgemcp-sqlalchemy -->
12
+
13
+ ## What it does
14
+
15
+ <!-- One sentence. -->
16
+
17
+ ## Use case
18
+
19
+ <!-- Describe a real production scenario that requires this plugin. -->
20
+
21
+ ## Proposed plugin API
22
+
23
+ <!-- Sketch how a developer would use it. -->
24
+
25
+ ```python
26
+ from bridgemcp import BridgeMCP
27
+ from bridgemcp_logging import LoggingPlugin # example
28
+
29
+ app = BridgeMCP(name="my-server")
30
+ app.register_plugin(LoggingPlugin(level="INFO"))
31
+
32
+ ```
33
+
34
+ ## Type
35
+
36
+ - [ ] I am requesting an official plugin (maintained by the BridgeMCP project)
37
+ - [ ] I am requesting listing of an existing community plugin
38
+
39
+ ## Existing community plugin URL
40
+
41
+ <!-- If this is a listing request, paste the repository URL here. -->
@@ -0,0 +1,30 @@
1
+ ## Summary
2
+
3
+ <!-- What does this PR do? One paragraph is enough for most changes. -->
4
+
5
+ ## Type of change
6
+
7
+ - [ ] Bug fix (non-breaking change that fixes an issue)
8
+ - [ ] Performance improvement
9
+ - [ ] Documentation update
10
+ - [ ] New core feature (please link to the approved feature request issue)
11
+ - [ ] Other (describe):
12
+
13
+ ## Checklist
14
+
15
+ - [ ] `pytest` passes with no new failures
16
+ - [ ] `ruff check bridgemcp tests` reports no issues
17
+ - [ ] `black --check bridgemcp tests` reports no changes
18
+ - [ ] New behavior is covered by tests
19
+ - [ ] Public API changes are documented in docstrings
20
+ - [ ] CHANGELOG has an entry under `[Unreleased]`
21
+ - [ ] No `_`-prefixed internal names were introduced into the public API
22
+ - [ ] No import of `mcp` or `fastmcp` was added outside `bridgemcp/adapters/mcp.py`
23
+
24
+ ## Related issues
25
+
26
+ <!-- Closes #xxx -->
27
+
28
+ ## Notes for reviewers
29
+
30
+ <!-- Anything that would help the reviewer understand the approach, trade-offs, or decisions made. -->
@@ -0,0 +1,37 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: ["main", "develop"]
6
+ pull_request:
7
+ branches: ["main"]
8
+
9
+ jobs:
10
+ test:
11
+ name: Python ${{ matrix.python-version }}
12
+ runs-on: ubuntu-latest
13
+
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ python-version: ["3.11", "3.12", "3.13"]
18
+
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - name: Set up Python ${{ matrix.python-version }}
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+
27
+ - name: Install dependencies
28
+ run: pip install -e '.[mcp,dev]'
29
+
30
+ - name: Lint (ruff)
31
+ run: ruff check bridgemcp tests
32
+
33
+ - name: Check formatting (black)
34
+ run: black --check bridgemcp tests
35
+
36
+ - name: Run tests
37
+ run: pytest tests/ -v --tb=short
@@ -0,0 +1,46 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.pyo
5
+ *.pyd
6
+ *.so
7
+ *.egg
8
+ *.egg-info/
9
+ dist/
10
+ build/
11
+ .eggs/
12
+
13
+ # Virtual environments
14
+ .venv/
15
+ venv/
16
+ env/
17
+ .env
18
+
19
+ # uv
20
+ .uv/
21
+ uv.lock
22
+
23
+ # Environment files
24
+ .env
25
+ .env.local
26
+ .env.*.local
27
+
28
+ # Testing
29
+ .pytest_cache/
30
+ .coverage
31
+ htmlcov/
32
+ .tox/
33
+
34
+ # Type checking
35
+ .pyright/
36
+ .mypy_cache/
37
+
38
+ # Editors
39
+ .vscode/
40
+ .idea/
41
+ *.swp
42
+ *.swo
43
+ .DS_Store
44
+
45
+ # Graphify (used during development)
46
+ graphify-out/