http-mcp 0.8.1__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.
- http_mcp-0.8.1/.cursor/rules/python-style.mdc +50 -0
- http_mcp-0.8.1/.envrc +11 -0
- http_mcp-0.8.1/.gemini/settings.json +6 -0
- http_mcp-0.8.1/.githooks/pre-push +1 -0
- http_mcp-0.8.1/.github/workflows/dev.yml +40 -0
- http_mcp-0.8.1/.github/workflows/publish.yml +75 -0
- http_mcp-0.8.1/.github/workflows/sast-scan.yml +16 -0
- http_mcp-0.8.1/.github/workflows/sca-scan.yml +16 -0
- http_mcp-0.8.1/.gitignore +11 -0
- http_mcp-0.8.1/.python-version +1 -0
- http_mcp-0.8.1/.vscode/settings.json +22 -0
- http_mcp-0.8.1/AGENT.md +30 -0
- http_mcp-0.8.1/LICENSE +21 -0
- http_mcp-0.8.1/PKG-INFO +870 -0
- http_mcp-0.8.1/README.md +846 -0
- http_mcp-0.8.1/assets/gemini_test.png +0 -0
- http_mcp-0.8.1/fluidattacks_sast_config.yaml +39 -0
- http_mcp-0.8.1/fluidattacks_sca_config.yaml +29 -0
- http_mcp-0.8.1/fluidattacks_scanners_config.yaml +26 -0
- http_mcp-0.8.1/mypy.ini +30 -0
- http_mcp-0.8.1/pyproject.toml +49 -0
- http_mcp-0.8.1/ruff.toml +30 -0
- http_mcp-0.8.1/src/http_mcp/__init__.py +1 -0
- http_mcp-0.8.1/src/http_mcp/_stdio_transport.py +127 -0
- http_mcp-0.8.1/src/http_mcp/_transport_base.py +236 -0
- http_mcp-0.8.1/src/http_mcp/_transport_http.py +204 -0
- http_mcp-0.8.1/src/http_mcp/_transport_types.py +19 -0
- http_mcp-0.8.1/src/http_mcp/exceptions.py +53 -0
- http_mcp-0.8.1/src/http_mcp/mcp_types/__init__.py +0 -0
- http_mcp-0.8.1/src/http_mcp/mcp_types/capabilities.py +11 -0
- http_mcp-0.8.1/src/http_mcp/mcp_types/content.py +8 -0
- http_mcp-0.8.1/src/http_mcp/mcp_types/messages.py +82 -0
- http_mcp-0.8.1/src/http_mcp/mcp_types/prompts.py +62 -0
- http_mcp-0.8.1/src/http_mcp/mcp_types/tools.py +48 -0
- http_mcp-0.8.1/src/http_mcp/py.typed +0 -0
- http_mcp-0.8.1/src/http_mcp/server.py +107 -0
- http_mcp-0.8.1/src/http_mcp/server_interface.py +55 -0
- http_mcp-0.8.1/src/http_mcp/types/__init__.py +5 -0
- http_mcp-0.8.1/src/http_mcp/types/models.py +39 -0
- http_mcp-0.8.1/src/http_mcp/types/prompts.py +108 -0
- http_mcp-0.8.1/src/http_mcp/types/tools.py +162 -0
- http_mcp-0.8.1/src/http_mcp/types/utils.py +39 -0
- http_mcp-0.8.1/tests/__init__.py +0 -0
- http_mcp-0.8.1/tests/app/__init__.py +1 -0
- http_mcp-0.8.1/tests/app/context.py +12 -0
- http_mcp-0.8.1/tests/app/main.py +90 -0
- http_mcp-0.8.1/tests/app/prompts.py +106 -0
- http_mcp-0.8.1/tests/app/test_app.py +122 -0
- http_mcp-0.8.1/tests/app/tools.py +129 -0
- http_mcp-0.8.1/tests/models.py +34 -0
- http_mcp-0.8.1/tests/smoke_test.py +64 -0
- http_mcp-0.8.1/tests/test_base_transport.py +126 -0
- http_mcp-0.8.1/tests/test_http_transport.py +106 -0
- http_mcp-0.8.1/tests/test_initialization.py +79 -0
- http_mcp-0.8.1/tests/test_models.py +58 -0
- http_mcp-0.8.1/tests/test_prompts_methods.py +360 -0
- http_mcp-0.8.1/tests/test_server_with_context.py +71 -0
- http_mcp-0.8.1/tests/test_server_without_context.py +98 -0
- http_mcp-0.8.1/tests/test_studio_transport.py +146 -0
- http_mcp-0.8.1/tests/test_tools_methods.py +584 -0
- http_mcp-0.8.1/uv.lock +949 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
description:
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
# Python Style Guide and Best Practices
|
|
7
|
+
|
|
8
|
+
## Type Hints
|
|
9
|
+
- All function parameters MUST have type hints
|
|
10
|
+
- All function return values MUST have type hints
|
|
11
|
+
- All class attributes MUST have type hints
|
|
12
|
+
- Use `collections.abc` for abstract base classes (Sequence, Mapping, Set, etc.)
|
|
13
|
+
- Use built-in types for simple type hints (str, int, bool, list, dict, etc.)
|
|
14
|
+
- Use `type | None` instead of `Optional[type]`
|
|
15
|
+
- Example:
|
|
16
|
+
```python
|
|
17
|
+
from collections.abc import Sequence
|
|
18
|
+
|
|
19
|
+
def process_data(items: Sequence[str], max_items: int | None = None) -> dict[str, int]:
|
|
20
|
+
...
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Functional Programming Paradigm
|
|
24
|
+
- Prefer pure functions over methods with side effects
|
|
25
|
+
- Use immutable data structures when possible, prefer tuples over lists
|
|
26
|
+
- Avoid modifying function arguments
|
|
27
|
+
- Use list/dict comprehensions instead of loops when possible
|
|
28
|
+
- Minimize global state and mutable variables
|
|
29
|
+
- Return new values instead of modifying existing ones
|
|
30
|
+
- Example:
|
|
31
|
+
```python
|
|
32
|
+
# Good - Pure function, immutable
|
|
33
|
+
def transform_data(data: list[int]) -> list[int]:
|
|
34
|
+
return [x * 2 for x in data if x > 0]
|
|
35
|
+
|
|
36
|
+
# Bad - Modifies input, has side effects
|
|
37
|
+
def transform_data(data: list[int]) -> None:
|
|
38
|
+
for i in range(len(data)):
|
|
39
|
+
data[i] *= 2
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Code Organization
|
|
43
|
+
- Keep functions small and focused on a single responsibility
|
|
44
|
+
- Use composition over inheritance
|
|
45
|
+
- Prefer dependency injection over global state
|
|
46
|
+
- Use descriptive variable names that reflect their purpose
|
|
47
|
+
|
|
48
|
+
## Testing
|
|
49
|
+
- Write unit tests for all pure functions
|
|
50
|
+
- Test edge cases and error conditions
|
http_mcp-0.8.1/.envrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
: && ruff check && mypy . && pytest --cov-report term-missing --cov=src --cov-fail-under=90 tests/ && mdformat . --wrap 80
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
permissions: read-all
|
|
2
|
+
concurrency:
|
|
3
|
+
cancel-in-progress: true
|
|
4
|
+
group: ${{ github.actor }}
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
test:
|
|
8
|
+
name: test
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@c2d88d3ecc89a9ef08eebf45d9637801dcee7eb5
|
|
13
|
+
|
|
14
|
+
- name: "Set up Python"
|
|
15
|
+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
|
|
16
|
+
with:
|
|
17
|
+
python-version-file: "pyproject.toml"
|
|
18
|
+
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@06e4edb239928eb926db9fa84abd11632bf44baa
|
|
21
|
+
|
|
22
|
+
- name: Install the project
|
|
23
|
+
run: uv sync --locked --all-extras --dev
|
|
24
|
+
|
|
25
|
+
- name: Run tests
|
|
26
|
+
run: uv run pytest --cov=src --cov-fail-under=90 tests/
|
|
27
|
+
|
|
28
|
+
- name: Run mypy
|
|
29
|
+
run: uv run mypy . --config-file mypy.ini
|
|
30
|
+
|
|
31
|
+
- name: Run ruff
|
|
32
|
+
run: uv run ruff check .
|
|
33
|
+
|
|
34
|
+
- name: Run mdformat
|
|
35
|
+
run: uv run mdformat README.md --check --wrap 80
|
|
36
|
+
|
|
37
|
+
name: dev
|
|
38
|
+
on:
|
|
39
|
+
pull_request:
|
|
40
|
+
branches: [main]
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths:
|
|
8
|
+
- 'pyproject.toml'
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: write
|
|
12
|
+
id-token: write # Required for trusted publishing to PyPI
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
publish:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
environment:
|
|
18
|
+
name: pypi
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout
|
|
21
|
+
uses: actions/checkout@c2d88d3ecc89a9ef08eebf45d9637801dcee7eb5
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0 # Fetch all history for proper tagging
|
|
24
|
+
|
|
25
|
+
- name: Extract version from pyproject.toml
|
|
26
|
+
id: get_version
|
|
27
|
+
run: |
|
|
28
|
+
VERSION=$(grep -E '^version = ' pyproject.toml | sed -E 's/version = "(.*)"/\1/')
|
|
29
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
30
|
+
echo "Detected version: $VERSION"
|
|
31
|
+
|
|
32
|
+
- name: Check if tag exists
|
|
33
|
+
id: check_tag
|
|
34
|
+
run: |
|
|
35
|
+
if git rev-parse "v${{ steps.get_version.outputs.version }}" >/dev/null 2>&1; then
|
|
36
|
+
echo "exists=true" >> $GITHUB_OUTPUT
|
|
37
|
+
echo "Tag v${{ steps.get_version.outputs.version }} already exists"
|
|
38
|
+
else
|
|
39
|
+
echo "exists=false" >> $GITHUB_OUTPUT
|
|
40
|
+
echo "Tag v${{ steps.get_version.outputs.version }} does not exist"
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
- name: Create and push tag
|
|
44
|
+
if: steps.check_tag.outputs.exists == 'false'
|
|
45
|
+
run: |
|
|
46
|
+
git config user.name "github-actions[bot]"
|
|
47
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
48
|
+
git tag -a "v${{ steps.get_version.outputs.version }}" -m "Release version ${{ steps.get_version.outputs.version }}"
|
|
49
|
+
git push origin "v${{ steps.get_version.outputs.version }}"
|
|
50
|
+
|
|
51
|
+
- name: Install uv
|
|
52
|
+
if: steps.check_tag.outputs.exists == 'false'
|
|
53
|
+
uses: astral-sh/setup-uv@v6
|
|
54
|
+
|
|
55
|
+
- name: Install Python 3.13
|
|
56
|
+
if: steps.check_tag.outputs.exists == 'false'
|
|
57
|
+
run: uv python install 3.13
|
|
58
|
+
|
|
59
|
+
- name: Build
|
|
60
|
+
if: steps.check_tag.outputs.exists == 'false'
|
|
61
|
+
run: uv build
|
|
62
|
+
|
|
63
|
+
# Check that basic features work and we didn't miss to include crucial files
|
|
64
|
+
- name: Smoke test (wheel)
|
|
65
|
+
if: steps.check_tag.outputs.exists == 'false'
|
|
66
|
+
run: uv run --isolated --no-project --with dist/*.whl tests/smoke_test.py
|
|
67
|
+
|
|
68
|
+
- name: Smoke test (source distribution)
|
|
69
|
+
if: steps.check_tag.outputs.exists == 'false'
|
|
70
|
+
run: uv run --isolated --no-project --with dist/*.tar.gz tests/smoke_test.py
|
|
71
|
+
|
|
72
|
+
- name: Publish to PyPI
|
|
73
|
+
if: steps.check_tag.outputs.exists == 'false'
|
|
74
|
+
run: uv publish
|
|
75
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: SAST Security Scan
|
|
2
|
+
on: [push]
|
|
3
|
+
|
|
4
|
+
jobs:
|
|
5
|
+
sast-scan:
|
|
6
|
+
runs-on: ubuntu-latest
|
|
7
|
+
steps:
|
|
8
|
+
- name: Checkout repository
|
|
9
|
+
uses: actions/checkout@c2d88d3ecc89a9ef08eebf45d9637801dcee7eb5
|
|
10
|
+
|
|
11
|
+
- name: Run SAST Scanner
|
|
12
|
+
# NOFLUID: use always the latest version
|
|
13
|
+
uses: docker://docker.io/fluidattacks/sast:latest
|
|
14
|
+
with:
|
|
15
|
+
args: sast scan fluidattacks_sast_config.yaml
|
|
16
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: SCA Security Scan
|
|
2
|
+
on: [push]
|
|
3
|
+
|
|
4
|
+
jobs:
|
|
5
|
+
sca-scan:
|
|
6
|
+
runs-on: ubuntu-latest
|
|
7
|
+
steps:
|
|
8
|
+
- name: Checkout repository
|
|
9
|
+
uses: actions/checkout@c2d88d3ecc89a9ef08eebf45d9637801dcee7eb5
|
|
10
|
+
|
|
11
|
+
- name: Run SCA Scanner
|
|
12
|
+
# NOFLUID: use always the latest version
|
|
13
|
+
uses: docker://docker.io/fluidattacks/sca:latest
|
|
14
|
+
with:
|
|
15
|
+
args: sca scan fluidattacks_sca_config.yaml
|
|
16
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"[python]": {
|
|
3
|
+
"editor.codeActionsOnSave": {
|
|
4
|
+
"source.fixAll": "explicit",
|
|
5
|
+
"source.organizeImports": "explicit"
|
|
6
|
+
},
|
|
7
|
+
"editor.rulers": [100],
|
|
8
|
+
"editor.tabSize": 4,
|
|
9
|
+
"editor.defaultFormatter": "charliermarsh.ruff"
|
|
10
|
+
},
|
|
11
|
+
"mypy-type-checker.cwd": "/",
|
|
12
|
+
"ruff.configurationPreference": "filesystemFirst",
|
|
13
|
+
"ruff.organizeImports": true,
|
|
14
|
+
"ruff.lineLength": 100,
|
|
15
|
+
"mypy-type-checker.args": ["--explicit-package-bases", "--config-file", "mypy.ini"],
|
|
16
|
+
"python.testing.pytestArgs": [
|
|
17
|
+
"test",
|
|
18
|
+
"-vv"
|
|
19
|
+
],
|
|
20
|
+
"python.testing.pytestEnabled": true,
|
|
21
|
+
"python.testing.unittestEnabled": false
|
|
22
|
+
}
|
http_mcp-0.8.1/AGENT.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Project
|
|
2
|
+
|
|
3
|
+
## Project description
|
|
4
|
+
|
|
5
|
+
This project is a base python project environment configuration using uv.
|
|
6
|
+
|
|
7
|
+
## General Instructions:
|
|
8
|
+
|
|
9
|
+
- When generating new python code, please follow the following coding style:
|
|
10
|
+
- Use 4 spaces for indentation.
|
|
11
|
+
- Use snake_case for variable names, functions, and parameters.
|
|
12
|
+
- Use PascalCase for class names.
|
|
13
|
+
- Prefer functional programming paradigms where appropriate.
|
|
14
|
+
- Use type hints for all functions, classes, and parameters as well as return
|
|
15
|
+
values.
|
|
16
|
+
- Use immutable data structures when possible, prefer tuples over lists.
|
|
17
|
+
- Avoid modifying function arguments.
|
|
18
|
+
- Use list/dict comprehensions instead of loops when possible.
|
|
19
|
+
- Minimize global state and mutable variables.
|
|
20
|
+
- Return new values instead of modifying existing ones.
|
|
21
|
+
- Keep functions small and focused on a single responsibility.
|
|
22
|
+
|
|
23
|
+
## Tools usage
|
|
24
|
+
|
|
25
|
+
- context7: when the user requests code examples, setup or configuration steps,
|
|
26
|
+
or library/API documentation, use this tool to generate the code.
|
|
27
|
+
- file_reader: when the user requests to read a file, use this tool to read the
|
|
28
|
+
file.
|
|
29
|
+
- safe_tool: when the user requests to run a command, use this tool to run the
|
|
30
|
+
command.
|
http_mcp-0.8.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Yeison Liscano
|
|
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.
|