feat: add MCP server core, stdio and streamable HTTP transports and serve command
Low-level SDK server built from the catalog plus gitea_api_request, with TOOLSETS/READ_ONLY/DISABLED_TOOLS filters, schema validation without value echo, one audit event per call, static bearer verifier, identity resolver hook, /health, DNS-rebinding protection, rate limiting and fail-closed startup checks.
This commit is contained in:
1 parent
581ca67bf8
commit
c9e2c481e7
11 files changed
+2846
-14
No files matched your search
+4
-6
@@ -8,6 +8,7 @@ import pytest
|
||||
|
||||
from aegis_gitea_mcp import __version__
|
||||
from aegis_gitea_mcp.cli import build_parser, main
|
||||
from tests.test_server_helpers import ANY_HOST
|
||||
|
||||
|
||||
def test_version_prints_package_version(capsys: pytest.CaptureFixture[str]) -> None:
|
||||
@@ -15,12 +16,9 @@ def test_version_prints_package_version(capsys: pytest.CaptureFixture[str]) -> N
|
||||
assert capsys.readouterr().out.strip() == __version__
|
||||
|
||||
|
||||
@pytest.mark.parametrize("argv", [[], ["serve"], ["serve", "--transport", "http"]])
|
||||
def test_unbuilt_commands_exit_2(argv: list[str], capsys: pytest.CaptureFixture[str]) -> None:
|
||||
assert main(argv) == 2
|
||||
captured = capsys.readouterr()
|
||||
assert "not implemented yet" in captured.err
|
||||
assert captured.out == ""
|
||||
def test_serve_parses_host_and_port() -> None:
|
||||
args = build_parser().parse_args(["serve", "--host", ANY_HOST, "--port", "9000"])
|
||||
assert (args.host, args.port) == (ANY_HOST, 9000)
|
||||
|
||||
|
||||
def test_serve_transport_choices() -> None:
|
||||
|
||||
Reference in new issue
Block a user