mcptoolforge 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.
Files changed (57) hide show
  1. mcptoolforge-0.1.0/.github/workflows/publish.yml +65 -0
  2. mcptoolforge-0.1.0/.gitignore +146 -0
  3. mcptoolforge-0.1.0/LICENSE +21 -0
  4. mcptoolforge-0.1.0/PKG-INFO +655 -0
  5. mcptoolforge-0.1.0/README.md +640 -0
  6. mcptoolforge-0.1.0/examples/basic_mcp_server.py +31 -0
  7. mcptoolforge-0.1.0/examples/prompts_mcp_server.py +21 -0
  8. mcptoolforge-0.1.0/examples/resources_mcp_server.py +28 -0
  9. mcptoolforge-0.1.0/examples/test_server.py +60 -0
  10. mcptoolforge-0.1.0/pyproject.toml +44 -0
  11. mcptoolforge-0.1.0/src/mcptoolforge/__init__.py +64 -0
  12. mcptoolforge-0.1.0/src/mcptoolforge/cli/__init__.py +1 -0
  13. mcptoolforge-0.1.0/src/mcptoolforge/cli/commands.py +278 -0
  14. mcptoolforge-0.1.0/src/mcptoolforge/cli/main.py +101 -0
  15. mcptoolforge-0.1.0/src/mcptoolforge/config.py +45 -0
  16. mcptoolforge-0.1.0/src/mcptoolforge/decorators.py +49 -0
  17. mcptoolforge-0.1.0/src/mcptoolforge/errors.py +94 -0
  18. mcptoolforge-0.1.0/src/mcptoolforge/execution.py +25 -0
  19. mcptoolforge-0.1.0/src/mcptoolforge/mcp/__init__.py +4 -0
  20. mcptoolforge-0.1.0/src/mcptoolforge/mcp/adapter.py +405 -0
  21. mcptoolforge-0.1.0/src/mcptoolforge/mcp/server.py +111 -0
  22. mcptoolforge-0.1.0/src/mcptoolforge/middleware/__init__.py +11 -0
  23. mcptoolforge-0.1.0/src/mcptoolforge/middleware/context.py +15 -0
  24. mcptoolforge-0.1.0/src/mcptoolforge/middleware/logging.py +30 -0
  25. mcptoolforge-0.1.0/src/mcptoolforge/middleware/manager.py +68 -0
  26. mcptoolforge-0.1.0/src/mcptoolforge/middleware/timing.py +37 -0
  27. mcptoolforge-0.1.0/src/mcptoolforge/project.py +134 -0
  28. mcptoolforge-0.1.0/src/mcptoolforge/prompts/__init__.py +5 -0
  29. mcptoolforge-0.1.0/src/mcptoolforge/prompts/decorator.py +32 -0
  30. mcptoolforge-0.1.0/src/mcptoolforge/prompts/prompt.py +129 -0
  31. mcptoolforge-0.1.0/src/mcptoolforge/prompts/registry.py +37 -0
  32. mcptoolforge-0.1.0/src/mcptoolforge/registry.py +241 -0
  33. mcptoolforge-0.1.0/src/mcptoolforge/resources/__init__.py +5 -0
  34. mcptoolforge-0.1.0/src/mcptoolforge/resources/decorator.py +33 -0
  35. mcptoolforge-0.1.0/src/mcptoolforge/resources/registry.py +39 -0
  36. mcptoolforge-0.1.0/src/mcptoolforge/resources/resource.py +97 -0
  37. mcptoolforge-0.1.0/src/mcptoolforge/schema.py +146 -0
  38. mcptoolforge-0.1.0/src/mcptoolforge/server.py +91 -0
  39. mcptoolforge-0.1.0/src/mcptoolforge/testing/__init__.py +15 -0
  40. mcptoolforge-0.1.0/src/mcptoolforge/testing/client.py +364 -0
  41. mcptoolforge-0.1.0/src/mcptoolforge/transports/__init__.py +1 -0
  42. mcptoolforge-0.1.0/src/mcptoolforge/validation.py +229 -0
  43. mcptoolforge-0.1.0/tests/integration/test_mcp_prompts.py +121 -0
  44. mcptoolforge-0.1.0/tests/integration/test_mcp_resources.py +126 -0
  45. mcptoolforge-0.1.0/tests/integration/test_mcp_server.py +159 -0
  46. mcptoolforge-0.1.0/tests/test_cli.py +179 -0
  47. mcptoolforge-0.1.0/tests/test_foundation.py +274 -0
  48. mcptoolforge-0.1.0/tests/test_import.py +15 -0
  49. mcptoolforge-0.1.0/tests/test_mcp.py +74 -0
  50. mcptoolforge-0.1.0/tests/test_metadata.py +277 -0
  51. mcptoolforge-0.1.0/tests/test_middleware.py +285 -0
  52. mcptoolforge-0.1.0/tests/test_project.py +330 -0
  53. mcptoolforge-0.1.0/tests/test_prompts.py +183 -0
  54. mcptoolforge-0.1.0/tests/test_resources.py +169 -0
  55. mcptoolforge-0.1.0/tests/test_schema.py +254 -0
  56. mcptoolforge-0.1.0/tests/test_testing.py +270 -0
  57. mcptoolforge-0.1.0/tests/test_validation.py +304 -0
@@ -0,0 +1,65 @@
1
+ name: Publish MCPToolForge to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+ id-token: write
10
+
11
+ jobs:
12
+ build-and-publish:
13
+ name: Build and publish MCPToolForge
14
+ runs-on: ubuntu-latest
15
+ environment: pypi
16
+
17
+ steps:
18
+ - name: Checkout source
19
+ uses: actions/checkout@v4
20
+
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.11"
25
+
26
+ - name: Install build dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ python -m pip install build twine
30
+
31
+ - name: Clean build directory
32
+ run: |
33
+ rm -rf dist build *.egg-info
34
+
35
+ - name: Build package artifacts
36
+ run: |
37
+ python -m build
38
+
39
+ - name: Verify build artifacts
40
+ run: |
41
+ if [ ! -d dist ]; then
42
+ echo "Error: dist directory does not exist."
43
+ exit 1
44
+ fi
45
+ # Check for wheel
46
+ WHEEL_COUNT=$(find dist -maxdepth 1 -name "*.whl" | wc -l)
47
+ if [ "$WHEEL_COUNT" -eq 0 ]; then
48
+ echo "Error: No wheel artifact found in dist/."
49
+ exit 1
50
+ fi
51
+ # Check for source distribution
52
+ SDIST_COUNT=$(find dist -maxdepth 1 -name "*.tar.gz" | wc -l)
53
+ if [ "$SDIST_COUNT" -eq 0 ]; then
54
+ echo "Error: No source distribution found in dist/."
55
+ exit 1
56
+ fi
57
+ echo "Build artifacts verified successfully:"
58
+ ls -la dist/
59
+
60
+ - name: Validate metadata via Twine
61
+ run: |
62
+ twine check dist/*
63
+
64
+ - name: Publish to PyPI
65
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,146 @@
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
+ build/
11
+ develop-eggs/
12
+ dist/
13
+ downloads/
14
+ eggs/
15
+ .eggs/
16
+ lib/
17
+ lib64/
18
+ parts/
19
+ sdist/
20
+ var/
21
+ wheels/
22
+ share/python-wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+ MANIFEST
27
+
28
+ # PyInstaller
29
+ # Usually these files are written by a python script from a template
30
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
31
+ *.manifest
32
+ *.spec
33
+
34
+ # Installer logs
35
+ pip-log.txt
36
+ pip-delete-this-directory.txt
37
+
38
+ # Unit test / coverage reports
39
+ htmlcov/
40
+ .tol/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ *.py,cover
48
+ .fullname
49
+ .pytest_cache/
50
+ .pytest/
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
+ # Sphinx documentation
63
+ docs/_build/
64
+
65
+ # PyBuilder
66
+ .pybuilder/
67
+ target/
68
+
69
+ # Jupyter Notebook
70
+ .ipynb_checkpoints
71
+
72
+ # IPython
73
+ profile_default/
74
+ ipython_config.py
75
+
76
+ # pyenv
77
+ # For a library or app, you might want to share your .python-version.
78
+ # Comment this out if so.
79
+ # .python-version
80
+
81
+ # pipenv
82
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
83
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
84
+ # having no cross-platform support, pipenv may install dependencies that don't work, or fail to
85
+ # install at all. So it is recommended to keep Pipfile.lock in gitignore for libraries.
86
+ # Pipfile.lock
87
+
88
+ # poetry
89
+ # Similar to Pipfile.lock, poetry.lock is generally recommended to be committed.
90
+ # However, for libraries, you can choose to ignore it.
91
+ # poetry.lock
92
+
93
+ # pdm
94
+ # Similar to Poetry and Pipenv, pdm.lock is generally recommended to be committed.
95
+ # pdm.lock
96
+ # pdm build stage
97
+ .pdm-build/
98
+
99
+ # PEP 582; project local packages directory (used by pdm)
100
+ __pypackages__/
101
+
102
+ # Celery stuff
103
+ celerybeat-schedule
104
+ celerybeat.pid
105
+
106
+ # SageMath parsed files
107
+ *.sage.py
108
+
109
+ # Environments
110
+ .env
111
+ .venv
112
+ env/
113
+ venv/
114
+ ENV/
115
+ env.bak/
116
+ venv.bak/
117
+
118
+ # Spyder project settings
119
+ .spyderproject
120
+ .spyproject
121
+
122
+ # Rope project settings
123
+ .ropeproject
124
+
125
+ # mkdocs documentation
126
+ /site
127
+
128
+ # mypy
129
+ .mypy_cache/
130
+ .dmypy.json
131
+ dmypy.json
132
+
133
+ # Pyre type checker
134
+ .pyre/
135
+
136
+ # pytype static type analyzer
137
+ .pytype/
138
+
139
+ # Cython debug symbols
140
+ cython_debug/
141
+
142
+ # IDE files
143
+ .idea/
144
+ .vscode/
145
+ *.swp
146
+ *.swo
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MCPToolForge Contributors
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.