mcp-contextforge-gateway 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 (167) hide show
  1. mcp_contextforge_gateway-0.1.0/.coveragerc +14 -0
  2. mcp_contextforge_gateway-0.1.0/.darglint +2 -0
  3. mcp_contextforge_gateway-0.1.0/.dockerignore +178 -0
  4. mcp_contextforge_gateway-0.1.0/.env.ce.example +45 -0
  5. mcp_contextforge_gateway-0.1.0/.env.example +228 -0
  6. mcp_contextforge_gateway-0.1.0/.eslintrc.json +16 -0
  7. mcp_contextforge_gateway-0.1.0/.flake8 +2 -0
  8. mcp_contextforge_gateway-0.1.0/.hadolint.yaml +2 -0
  9. mcp_contextforge_gateway-0.1.0/.htmlhintrc +7 -0
  10. mcp_contextforge_gateway-0.1.0/.markdownlint.json +7 -0
  11. mcp_contextforge_gateway-0.1.0/.pre-commit-config.yaml +507 -0
  12. mcp_contextforge_gateway-0.1.0/.pycodestyle +5 -0
  13. mcp_contextforge_gateway-0.1.0/.pylintrc +649 -0
  14. mcp_contextforge_gateway-0.1.0/.pyspelling.yml +28 -0
  15. mcp_contextforge_gateway-0.1.0/.ruff.toml +63 -0
  16. mcp_contextforge_gateway-0.1.0/.spellcheck-en.txt +440 -0
  17. mcp_contextforge_gateway-0.1.0/.stylelintrc.json +6 -0
  18. mcp_contextforge_gateway-0.1.0/.travis.yml +72 -0
  19. mcp_contextforge_gateway-0.1.0/.whitesource +1 -0
  20. mcp_contextforge_gateway-0.1.0/CHANGELOG.md +60 -0
  21. mcp_contextforge_gateway-0.1.0/CODE_OF_CONDUCT.md +5 -0
  22. mcp_contextforge_gateway-0.1.0/CONTRIBUTING.md +84 -0
  23. mcp_contextforge_gateway-0.1.0/Containerfile +42 -0
  24. mcp_contextforge_gateway-0.1.0/Containerfile.lite +139 -0
  25. mcp_contextforge_gateway-0.1.0/DEVELOPING.md +29 -0
  26. mcp_contextforge_gateway-0.1.0/LICENSE +201 -0
  27. mcp_contextforge_gateway-0.1.0/MANIFEST.in +50 -0
  28. mcp_contextforge_gateway-0.1.0/PKG-INFO +1251 -0
  29. mcp_contextforge_gateway-0.1.0/README.md +1147 -0
  30. mcp_contextforge_gateway-0.1.0/SECURITY.md +17 -0
  31. mcp_contextforge_gateway-0.1.0/TESTING.md +103 -0
  32. mcp_contextforge_gateway-0.1.0/docker-compose.yml +311 -0
  33. mcp_contextforge_gateway-0.1.0/docs/.gitignore +7 -0
  34. mcp_contextforge_gateway-0.1.0/docs/Makefile +94 -0
  35. mcp_contextforge_gateway-0.1.0/docs/base.yml +161 -0
  36. mcp_contextforge_gateway-0.1.0/docs/create.sh +89 -0
  37. mcp_contextforge_gateway-0.1.0/docs/docs/.pages +9 -0
  38. mcp_contextforge_gateway-0.1.0/docs/docs/architecture/.pages +4 -0
  39. mcp_contextforge_gateway-0.1.0/docs/docs/architecture/adr/.pages +12 -0
  40. mcp_contextforge_gateway-0.1.0/docs/docs/architecture/adr/001-adopt-fastapi-pydantic.md +41 -0
  41. mcp_contextforge_gateway-0.1.0/docs/docs/architecture/adr/002-use-async-sqlalchemy-orm.md +47 -0
  42. mcp_contextforge_gateway-0.1.0/docs/docs/architecture/adr/003-expose-multi-transport-endpoints.md +47 -0
  43. mcp_contextforge_gateway-0.1.0/docs/docs/architecture/adr/004-combine-jwt-and-basic-auth.md +51 -0
  44. mcp_contextforge_gateway-0.1.0/docs/docs/architecture/adr/005-structured-json-logging.md +50 -0
  45. mcp_contextforge_gateway-0.1.0/docs/docs/architecture/adr/006-gateway-tool-rate-limiting.md +50 -0
  46. mcp_contextforge_gateway-0.1.0/docs/docs/architecture/adr/007-pluggable-cache-backend.md +51 -0
  47. mcp_contextforge_gateway-0.1.0/docs/docs/architecture/adr/008-federation-discovery.md +54 -0
  48. mcp_contextforge_gateway-0.1.0/docs/docs/architecture/adr/009-built-in-health-checks.md +53 -0
  49. mcp_contextforge_gateway-0.1.0/docs/docs/architecture/adr/010-observability-prometheus.md +59 -0
  50. mcp_contextforge_gateway-0.1.0/docs/docs/architecture/adr/index.md +18 -0
  51. mcp_contextforge_gateway-0.1.0/docs/docs/architecture/index.md +56 -0
  52. mcp_contextforge_gateway-0.1.0/docs/docs/blog/index.md +1 -0
  53. mcp_contextforge_gateway-0.1.0/docs/docs/deployment/.pages +14 -0
  54. mcp_contextforge_gateway-0.1.0/docs/docs/deployment/aws.md +82 -0
  55. mcp_contextforge_gateway-0.1.0/docs/docs/deployment/azure.md +84 -0
  56. mcp_contextforge_gateway-0.1.0/docs/docs/deployment/compose.md +159 -0
  57. mcp_contextforge_gateway-0.1.0/docs/docs/deployment/container.md +83 -0
  58. mcp_contextforge_gateway-0.1.0/docs/docs/deployment/google-cloud-run.md +473 -0
  59. mcp_contextforge_gateway-0.1.0/docs/docs/deployment/helm.md +259 -0
  60. mcp_contextforge_gateway-0.1.0/docs/docs/deployment/ibm-code-engine.md +458 -0
  61. mcp_contextforge_gateway-0.1.0/docs/docs/deployment/index.md +56 -0
  62. mcp_contextforge_gateway-0.1.0/docs/docs/deployment/kubernetes.md +126 -0
  63. mcp_contextforge_gateway-0.1.0/docs/docs/deployment/local.md +67 -0
  64. mcp_contextforge_gateway-0.1.0/docs/docs/deployment/minikube.md +329 -0
  65. mcp_contextforge_gateway-0.1.0/docs/docs/deployment/openshift.md +231 -0
  66. mcp_contextforge_gateway-0.1.0/docs/docs/development/.pages +6 -0
  67. mcp_contextforge_gateway-0.1.0/docs/docs/development/building.md +79 -0
  68. mcp_contextforge_gateway-0.1.0/docs/docs/development/github.md +377 -0
  69. mcp_contextforge_gateway-0.1.0/docs/docs/development/index.md +158 -0
  70. mcp_contextforge_gateway-0.1.0/docs/docs/development/packaging.md +83 -0
  71. mcp_contextforge_gateway-0.1.0/docs/docs/images/mcpgateway.gif +0 -0
  72. mcp_contextforge_gateway-0.1.0/docs/docs/images/mcpgateway.svg +1 -0
  73. mcp_contextforge_gateway-0.1.0/docs/docs/index.md +107 -0
  74. mcp_contextforge_gateway-0.1.0/docs/docs/manage/.pages +7 -0
  75. mcp_contextforge_gateway-0.1.0/docs/docs/manage/backup.md +121 -0
  76. mcp_contextforge_gateway-0.1.0/docs/docs/manage/index.md +53 -0
  77. mcp_contextforge_gateway-0.1.0/docs/docs/manage/logging.md +75 -0
  78. mcp_contextforge_gateway-0.1.0/docs/docs/manage/tuning.md +132 -0
  79. mcp_contextforge_gateway-0.1.0/docs/docs/manage/upgrade.md +63 -0
  80. mcp_contextforge_gateway-0.1.0/docs/docs/overview/.pages +5 -0
  81. mcp_contextforge_gateway-0.1.0/docs/docs/overview/features.md +96 -0
  82. mcp_contextforge_gateway-0.1.0/docs/docs/overview/index.md +27 -0
  83. mcp_contextforge_gateway-0.1.0/docs/docs/overview/ui.md +58 -0
  84. mcp_contextforge_gateway-0.1.0/docs/docs/testing/.pages +4 -0
  85. mcp_contextforge_gateway-0.1.0/docs/docs/testing/basic.md +317 -0
  86. mcp_contextforge_gateway-0.1.0/docs/docs/testing/index.md +19 -0
  87. mcp_contextforge_gateway-0.1.0/docs/docs/using/.pages +6 -0
  88. mcp_contextforge_gateway-0.1.0/docs/docs/using/agents/.pages +11 -0
  89. mcp_contextforge_gateway-0.1.0/docs/docs/using/agents/autogen.md +18 -0
  90. mcp_contextforge_gateway-0.1.0/docs/docs/using/agents/bee.md +110 -0
  91. mcp_contextforge_gateway-0.1.0/docs/docs/using/agents/crewai.md +20 -0
  92. mcp_contextforge_gateway-0.1.0/docs/docs/using/agents/index.md +36 -0
  93. mcp_contextforge_gateway-0.1.0/docs/docs/using/agents/langchain.md +79 -0
  94. mcp_contextforge_gateway-0.1.0/docs/docs/using/agents/langgraph.md +79 -0
  95. mcp_contextforge_gateway-0.1.0/docs/docs/using/agents/llamaindex.md +11 -0
  96. mcp_contextforge_gateway-0.1.0/docs/docs/using/agents/openai-sdk.md +15 -0
  97. mcp_contextforge_gateway-0.1.0/docs/docs/using/agents/semantic-kernel.md +18 -0
  98. mcp_contextforge_gateway-0.1.0/docs/docs/using/clients/.pages +9 -0
  99. mcp_contextforge_gateway-0.1.0/docs/docs/using/clients/claude-desktop.md +72 -0
  100. mcp_contextforge_gateway-0.1.0/docs/docs/using/clients/cline.md +86 -0
  101. mcp_contextforge_gateway-0.1.0/docs/docs/using/clients/continue.md +91 -0
  102. mcp_contextforge_gateway-0.1.0/docs/docs/using/clients/copilot.md +149 -0
  103. mcp_contextforge_gateway-0.1.0/docs/docs/using/clients/index.md +38 -0
  104. mcp_contextforge_gateway-0.1.0/docs/docs/using/clients/mcp-inspector.md +64 -0
  105. mcp_contextforge_gateway-0.1.0/docs/docs/using/clients/openwebui.md +98 -0
  106. mcp_contextforge_gateway-0.1.0/docs/docs/using/index.md +36 -0
  107. mcp_contextforge_gateway-0.1.0/docs/docs/using/mcpgateway-wrapper.md +146 -0
  108. mcp_contextforge_gateway-0.1.0/docs/mcp.db +0 -0
  109. mcp_contextforge_gateway-0.1.0/docs/mkdocs.yml +101 -0
  110. mcp_contextforge_gateway-0.1.0/docs/requirements.txt +90 -0
  111. mcp_contextforge_gateway-0.1.0/docs/theme/logo.png +0 -0
  112. mcp_contextforge_gateway-0.1.0/gunicorn.config.py +80 -0
  113. mcp_contextforge_gateway-0.1.0/mcp_contextforge_gateway.egg-info/SOURCES.txt +164 -0
  114. mcp_contextforge_gateway-0.1.0/mcpgateway/__init__.py +17 -0
  115. mcp_contextforge_gateway-0.1.0/mcpgateway/admin.py +1259 -0
  116. mcp_contextforge_gateway-0.1.0/mcpgateway/cache/__init__.py +15 -0
  117. mcp_contextforge_gateway-0.1.0/mcpgateway/cache/resource_cache.py +136 -0
  118. mcp_contextforge_gateway-0.1.0/mcpgateway/cache/session_registry.py +761 -0
  119. mcp_contextforge_gateway-0.1.0/mcpgateway/cli.py +105 -0
  120. mcp_contextforge_gateway-0.1.0/mcpgateway/config.py +401 -0
  121. mcp_contextforge_gateway-0.1.0/mcpgateway/db.py +1092 -0
  122. mcp_contextforge_gateway-0.1.0/mcpgateway/federation/__init__.py +26 -0
  123. mcp_contextforge_gateway-0.1.0/mcpgateway/federation/discovery.py +390 -0
  124. mcp_contextforge_gateway-0.1.0/mcpgateway/federation/forward.py +337 -0
  125. mcp_contextforge_gateway-0.1.0/mcpgateway/federation/manager.py +459 -0
  126. mcp_contextforge_gateway-0.1.0/mcpgateway/handlers/__init__.py +14 -0
  127. mcp_contextforge_gateway-0.1.0/mcpgateway/handlers/sampling.py +225 -0
  128. mcp_contextforge_gateway-0.1.0/mcpgateway/main.py +2058 -0
  129. mcp_contextforge_gateway-0.1.0/mcpgateway/py.typed +0 -0
  130. mcp_contextforge_gateway-0.1.0/mcpgateway/schemas.py +1210 -0
  131. mcp_contextforge_gateway-0.1.0/mcpgateway/services/__init__.py +29 -0
  132. mcp_contextforge_gateway-0.1.0/mcpgateway/services/completion_service.py +200 -0
  133. mcp_contextforge_gateway-0.1.0/mcpgateway/services/gateway_service.py +705 -0
  134. mcp_contextforge_gateway-0.1.0/mcpgateway/services/logging_service.py +162 -0
  135. mcp_contextforge_gateway-0.1.0/mcpgateway/services/prompt_service.py +740 -0
  136. mcp_contextforge_gateway-0.1.0/mcpgateway/services/resource_service.py +871 -0
  137. mcp_contextforge_gateway-0.1.0/mcpgateway/services/root_service.py +176 -0
  138. mcp_contextforge_gateway-0.1.0/mcpgateway/services/server_service.py +624 -0
  139. mcp_contextforge_gateway-0.1.0/mcpgateway/services/tool_service.py +841 -0
  140. mcp_contextforge_gateway-0.1.0/mcpgateway/static/admin.css +9 -0
  141. mcp_contextforge_gateway-0.1.0/mcpgateway/static/admin.js +1684 -0
  142. mcp_contextforge_gateway-0.1.0/mcpgateway/templates/admin.html +2465 -0
  143. mcp_contextforge_gateway-0.1.0/mcpgateway/transports/__init__.py +19 -0
  144. mcp_contextforge_gateway-0.1.0/mcpgateway/transports/base.py +48 -0
  145. mcp_contextforge_gateway-0.1.0/mcpgateway/transports/sse_transport.py +230 -0
  146. mcp_contextforge_gateway-0.1.0/mcpgateway/transports/stdio_transport.py +113 -0
  147. mcp_contextforge_gateway-0.1.0/mcpgateway/transports/websocket_transport.py +139 -0
  148. mcp_contextforge_gateway-0.1.0/mcpgateway/types.py +745 -0
  149. mcp_contextforge_gateway-0.1.0/mcpgateway/utils/create_jwt_token.py +234 -0
  150. mcp_contextforge_gateway-0.1.0/mcpgateway/utils/services_auth.py +78 -0
  151. mcp_contextforge_gateway-0.1.0/mcpgateway/utils/verify_credentials.py +182 -0
  152. mcp_contextforge_gateway-0.1.0/mcpgateway/validation/__init__.py +18 -0
  153. mcp_contextforge_gateway-0.1.0/mcpgateway/validation/jsonrpc.py +142 -0
  154. mcp_contextforge_gateway-0.1.0/mcpgateway/version.py +396 -0
  155. mcp_contextforge_gateway-0.1.0/mcpgateway-wrapper/src/mcpgateway_wrapper/__init__.py +20 -0
  156. mcp_contextforge_gateway-0.1.0/mcpgateway-wrapper/src/mcpgateway_wrapper/server.py +393 -0
  157. mcp_contextforge_gateway-0.1.0/os_deps.sh +125 -0
  158. mcp_contextforge_gateway-0.1.0/package-lock.json +1498 -0
  159. mcp_contextforge_gateway-0.1.0/package.json +5 -0
  160. mcp_contextforge_gateway-0.1.0/podman-compose-sonarqube.yaml +39 -0
  161. mcp_contextforge_gateway-0.1.0/pyproject.toml +286 -0
  162. mcp_contextforge_gateway-0.1.0/run-gunicorn.sh +69 -0
  163. mcp_contextforge_gateway-0.1.0/run.sh +195 -0
  164. mcp_contextforge_gateway-0.1.0/setup.cfg +4 -0
  165. mcp_contextforge_gateway-0.1.0/sonar-code.properties +7 -0
  166. mcp_contextforge_gateway-0.1.0/test_readme.py +36 -0
  167. mcp_contextforge_gateway-0.1.0/uv.lock +3315 -0
@@ -0,0 +1,14 @@
1
+ [run]
2
+ branch = True
3
+
4
+ [report]
5
+ exclude_lines =
6
+ pragma: no cover
7
+ def __repr__
8
+ if self.debug
9
+ raise AssertionError
10
+ raise NotImplentedError
11
+ if 0:
12
+ if __name__ == .__main__.:
13
+
14
+ ignore_errors = True
@@ -0,0 +1,2 @@
1
+ [darglint]
2
+ docstring_style=google
@@ -0,0 +1,178 @@
1
+ .github
2
+ docker-compose.yml
3
+ podman-compose-sonarqube.yaml
4
+
5
+ node_modules
6
+ docs/
7
+ .vscode
8
+ certs
9
+ mcp.db
10
+ public/
11
+ # VENV
12
+ .python37/
13
+ .python39/
14
+
15
+ # Byte-compiled / optimized / DLL files
16
+ __pycache__/
17
+ *.py[cod]
18
+ *$py.class
19
+
20
+ # Bak
21
+ *.bak
22
+
23
+ # C extensions
24
+ *.so
25
+
26
+ # Distribution / packaging
27
+ .wily/
28
+ .Python
29
+ build/
30
+ develop-eggs/
31
+ dist/
32
+ downloads/
33
+ eggs/
34
+ .eggs/
35
+ lib/
36
+ lib64/
37
+ parts/
38
+ sdist/
39
+ var/
40
+ wheels/
41
+ *.egg-info/
42
+ .installed.cfg
43
+ *.egg
44
+ MANIFEST
45
+
46
+ # PyInstaller
47
+ # Usually these files are written by a python script from a template
48
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
49
+ *.manifest
50
+ *.spec
51
+
52
+ # Installer logs
53
+ pip-log.txt
54
+ pip-delete-this-directory.txt
55
+
56
+ # Unit test / coverage reports
57
+ htmlcov/
58
+ .tox/
59
+ .nox/
60
+ .coverage
61
+ .coverage.*
62
+ .cache
63
+ nosetests.xml
64
+ coverage.xml
65
+ *.cover
66
+ .hypothesis/
67
+ .pytest_cache/
68
+
69
+ # Translations
70
+ *.mo
71
+ *.pot
72
+
73
+ # Django stuff:
74
+ *.log
75
+ local_settings.py
76
+ db.sqlite3
77
+
78
+ # Flask stuff:
79
+ instance/
80
+ .webassets-cache
81
+
82
+ # Scrapy stuff:
83
+ .scrapy
84
+
85
+ # Sphinx documentation
86
+ docs/_build/
87
+
88
+ # PyBuilder
89
+ target/
90
+
91
+ # Jupyter Notebook
92
+ .ipynb_checkpoints
93
+
94
+ # IPython
95
+ profile_default/
96
+ ipython_config.py
97
+
98
+ # pyenv
99
+ .python-version
100
+
101
+ # celery beat schedule file
102
+ celerybeat-schedule
103
+
104
+ # SageMath parsed files
105
+ *.sage.py
106
+
107
+ # Environments
108
+ .env
109
+ .venv
110
+ env/
111
+ venv/
112
+ ENV/
113
+ env.bak/
114
+ venv.bak/
115
+
116
+ # Spyder project settings
117
+ .spyderproject
118
+ .spyproject
119
+
120
+ # Rope project settings
121
+ .ropeproject
122
+
123
+ # mkdocs documentation
124
+ /site
125
+
126
+ # mypy
127
+ .mypy_cache/
128
+ .dmypy.json
129
+ dmypy.json
130
+
131
+ # Mac junk
132
+ .DS_Store
133
+
134
+ # MYPY cache
135
+ .mypy_cache
136
+ .idea/
137
+
138
+ # Sonar
139
+ .scannerwork
140
+
141
+ # vim
142
+ *.swp
143
+ *,cover
144
+
145
+ # Development folders
146
+ .git/
147
+ attic/
148
+ docs/
149
+ test/
150
+ tests/
151
+
152
+ # Configuration files
153
+ .bumpversion.cfg
154
+ .coveragerc
155
+ .editorconfig
156
+ .flake8
157
+ .hadolint.yaml
158
+ .pre-commit-config.yaml
159
+ .pycodestyle
160
+ .pylintrc
161
+ .pyre_configuration
162
+ .pyspelling.yaml
163
+ .ruff.toml
164
+ .shellcheckrc
165
+ .spellcheck-en.txt
166
+ .travis.*
167
+ .whitesource
168
+ Makefile
169
+ mypi.ini
170
+ pytest.ini
171
+ sonar-code.properties
172
+ test.sh
173
+ tox.ini
174
+ whitesource.config
175
+
176
+ # Misc
177
+ TODO.md
178
+ DEVELOPING.md
@@ -0,0 +1,45 @@
1
+ ###############################################################################
2
+ # IBM Cloud Code Engine – deployment-only variables
3
+ # • Required *only* when you deploy MCP Gateway to IBM Cloud.
4
+ # • These keys are consumed by the Makefile / ibmcloud CLI and are **NOT**
5
+ # injected into the running container.
6
+ # • Copy this file to `.env.ce`, fill in real values, keep it out of Git.
7
+ ###############################################################################
8
+
9
+ # ── Core IBM Cloud context ──────────────────────────────────────────────
10
+ # Region where your Code Engine project lives (e.g. us-south, eu-de, au-syd)
11
+ IBMCLOUD_REGION=us-south
12
+
13
+ # Resource group that owns the project (often "default")
14
+ IBMCLOUD_RESOURCE_GROUP=default
15
+
16
+ # Code Engine project name
17
+ IBMCLOUD_PROJECT=my-codeengine-project
18
+
19
+ # Desired application name in Code Engine
20
+ IBMCLOUD_CODE_ENGINE_APP=mcpgateway
21
+
22
+
23
+ # ── Container image details ─────────────────────────────────────────────
24
+ # Fully-qualified tag in IBM Container Registry
25
+ IBMCLOUD_IMAGE_NAME=us.icr.io/myspace/mcpgateway:latest
26
+
27
+ # Local tag produced by `make podman` or `make docker`
28
+ IBMCLOUD_IMG_PROD=mcpgateway/mcpgateway
29
+
30
+
31
+ # ── Authentication ──────────────────────────────────────────────────────
32
+ # IAM API key for scripted logins.
33
+ # Leave **blank** if you prefer interactive SSO (`ibmcloud login --sso`)
34
+ IBMCLOUD_API_KEY=
35
+
36
+
37
+ # ── Compute sizing (must match a valid CPU/MEM combo) ───────────────────
38
+ # Reference table: https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo
39
+ IBMCLOUD_CPU=1
40
+ IBMCLOUD_MEMORY=4G
41
+
42
+
43
+ # ── Registry secret ─────────────────────────────────────────────────────
44
+ # Name for the pull secret Code Engine uses to fetch from ICR
45
+ IBMCLOUD_REGISTRY_SECRET=my-regcred
@@ -0,0 +1,228 @@
1
+ #####################################
2
+ # Basic Application Settings
3
+ #####################################
4
+
5
+ # The public-facing name of your gateway (used in docs/UI)
6
+ APP_NAME=MCP_Gateway
7
+
8
+ # Bind address for HTTP server (0.0.0.0 for all interfaces)
9
+ HOST=0.0.0.0
10
+
11
+ # TCP port to listen on
12
+ PORT=4444
13
+
14
+ # SQLAlchemy connection string; leave as-is for local dev
15
+ # Examples:
16
+ # sqlite:///./mcp.db (local file-based)
17
+ # postgresql://user:pass@localhost:5432/mcp
18
+ DATABASE_URL=sqlite:///./mcp.db
19
+
20
+ # Optional root path for deployments under a subpath (e.g., /api)
21
+ # Leave empty for default (/)
22
+ # Example: APP_ROOT_PATH=/gateway
23
+ APP_ROOT_PATH=
24
+
25
+ #####################################
26
+ # Database Connection Pooling
27
+ #####################################
28
+
29
+ # Size of the SQLAlchemy connection pool (default is 200)
30
+ DB_POOL_SIZE=200
31
+
32
+ # Number of extra connections allowed beyond pool size
33
+ DB_MAX_OVERFLOW=10
34
+
35
+ # Max time (in seconds) to wait for a connection from pool
36
+ DB_POOL_TIMEOUT=30
37
+
38
+ # Recycle database connections after N seconds
39
+ DB_POOL_RECYCLE=3600
40
+
41
+ #####################################
42
+ # Cache Backend
43
+ #####################################
44
+
45
+ # Backend for caching (memory, redis, database, or none)
46
+ CACHE_TYPE=database
47
+
48
+ # If using Redis: provide full connection URL
49
+ # Example: redis://localhost:6379/0
50
+ REDIS_URL=redis://localhost:6379/0
51
+
52
+ # Prefix for cache keys (recommended to avoid collisions)
53
+ CACHE_PREFIX=mcpgw:
54
+
55
+ # TTL for user sessions (in seconds)
56
+ SESSION_TTL=3600
57
+
58
+ # TTL for ephemeral messages (like completions) in seconds
59
+ MESSAGE_TTL=600
60
+
61
+ #####################################
62
+ # Protocol Settings
63
+ #####################################
64
+
65
+ # MCP protocol version supported by this gateway
66
+ PROTOCOL_VERSION=2025-03-26
67
+
68
+ #####################################
69
+ # Authentication
70
+ #####################################
71
+
72
+ # Admin UI basic-auth credentials
73
+ BASIC_AUTH_USER=admin
74
+ BASIC_AUTH_PASSWORD=changeme
75
+
76
+ # Require any form of authentication (true or false)
77
+ AUTH_REQUIRED=true
78
+
79
+ # Secret used to sign JWTs (use long random value in prod)
80
+ JWT_SECRET_KEY=my-test-key
81
+
82
+ # Algorithm used to sign JWTs (e.g., HS256)
83
+ JWT_ALGORITHM=HS256
84
+
85
+ # Expiry time for generated JWT tokens (in minutes; e.g. 7 days)
86
+ TOKEN_EXPIRY=10080
87
+
88
+ # Used to derive an AES encryption key for secure auth storage
89
+ # Must be a non-empty string (e.g. passphrase or random secret)
90
+ AUTH_ENCRYPTION_SECRET=my-test-salt
91
+
92
+ #####################################
93
+ # Admin UI and API Toggles
94
+ #####################################
95
+
96
+ # Enable the visual Admin UI (true/false)
97
+ MCPGATEWAY_UI_ENABLED=true
98
+
99
+ # Enable the Admin API endpoints (true/false)
100
+ MCPGATEWAY_ADMIN_API_ENABLED=true
101
+
102
+ #####################################
103
+ # Security and CORS
104
+ #####################################
105
+
106
+ # Skip TLS certificate checks for upstream requests (not recommended in prod)
107
+ SKIP_SSL_VERIFY=false
108
+
109
+ # CORS origin allowlist (use JSON array of URLs)
110
+ # Example: ["http://localhost:3000"]
111
+ # Do not quote this value. Start with [] to ensure it's valid JSON.
112
+ ALLOWED_ORIGINS='["http://localhost", "http://localhost:4444"]'
113
+
114
+ # Enable CORS handling in the gateway
115
+ CORS_ENABLED=true
116
+
117
+ #####################################
118
+ # Logging
119
+ #####################################
120
+
121
+ # Logging verbosity level: DEBUG, INFO, WARNING, ERROR, CRITICAL
122
+ LOG_LEVEL=INFO
123
+
124
+ # Log format: json or text
125
+ LOG_FORMAT=json
126
+
127
+ # Optional path to write logs to file (leave empty to log to stdout)
128
+ #LOG_FILE=./logs/gateway.log
129
+
130
+ #####################################
131
+ # Transport Configuration
132
+ #####################################
133
+
134
+ # Transport mechanisms to expose (comma-separated): http, ws, sse, stdio, all
135
+ TRANSPORT_TYPE=all
136
+
137
+ # WebSocket ping interval (seconds)
138
+ WEBSOCKET_PING_INTERVAL=30
139
+
140
+ # SSE client retry timeout (milliseconds)
141
+ SSE_RETRY_TIMEOUT=5000
142
+
143
+ #####################################
144
+ # Federation
145
+ #####################################
146
+
147
+ # Enable federated mode (discovery + peer syncing)
148
+ FEDERATION_ENABLED=true
149
+
150
+ # Automatically discover peer gateways (e.g., via mDNS)
151
+ FEDERATION_DISCOVERY=false
152
+
153
+ # Explicit list of peers (JSON array of URLs). Do not quote this value.
154
+ FEDERATION_PEERS='[]'
155
+
156
+ # Timeout for federated requests (in seconds)
157
+ FEDERATION_TIMEOUT=30
158
+
159
+ # Frequency of syncing peers (in seconds)
160
+ FEDERATION_SYNC_INTERVAL=300
161
+
162
+ #####################################
163
+ # Resources
164
+ #####################################
165
+
166
+ # Maximum number of resources to keep in memory cache
167
+ RESOURCE_CACHE_SIZE=1000
168
+
169
+ # Time-to-live for resource cache (seconds)
170
+ RESOURCE_CACHE_TTL=3600
171
+
172
+ # Maximum allowed size for a resource (in bytes, e.g., 10MB)
173
+ MAX_RESOURCE_SIZE=10485760
174
+
175
+ #####################################
176
+ # Tools
177
+ #####################################
178
+
179
+ # Max execution time for tools (in seconds)
180
+ TOOL_TIMEOUT=60
181
+
182
+ # Number of retry attempts for failed tools
183
+ MAX_TOOL_RETRIES=3
184
+
185
+ # Max number of tool invocations per minute
186
+ TOOL_RATE_LIMIT=100
187
+
188
+ # Number of tools that can run simultaneously
189
+ TOOL_CONCURRENT_LIMIT=10
190
+
191
+ #####################################
192
+ # Prompts
193
+ #####################################
194
+
195
+ # How many prompt templates to cache
196
+ PROMPT_CACHE_SIZE=100
197
+
198
+ # Max size (in bytes) for a prompt template
199
+ MAX_PROMPT_SIZE=102400
200
+
201
+ # Timeout for rendering prompt templates (in seconds)
202
+ PROMPT_RENDER_TIMEOUT=10
203
+
204
+ #####################################
205
+ # Health Checks
206
+ #####################################
207
+
208
+ # How often to poll peer gateways (in seconds)
209
+ HEALTH_CHECK_INTERVAL=60
210
+
211
+ # Timeout for a single health check request (seconds)
212
+ HEALTH_CHECK_TIMEOUT=10
213
+
214
+ # Number of failed checks before marking peer unhealthy
215
+ UNHEALTHY_THRESHOLD=3
216
+
217
+ #####################################
218
+ # Development Settings
219
+ #####################################
220
+
221
+ # Enable dev mode features (e.g. schema debug)
222
+ DEV_MODE=false
223
+
224
+ # Reload app on code changes (dev only)
225
+ RELOAD=false
226
+
227
+ # Enable verbose logging/debug traces
228
+ DEBUG=false
@@ -0,0 +1,16 @@
1
+ {
2
+ "root": true,
3
+ "env": {
4
+ "browser": true,
5
+ "es2021": true
6
+ },
7
+ "extends": ["standard"],
8
+ "parserOptions": {
9
+ "ecmaVersion": 12,
10
+ "sourceType": "module"
11
+ },
12
+ "rules": {
13
+ "semi": ["error", "always"],
14
+ "quotes": ["error", "double"]
15
+ }
16
+ }
@@ -0,0 +1,2 @@
1
+ [flake8]
2
+ max-line-length = 600
@@ -0,0 +1,2 @@
1
+ ignored:
2
+ - SC1019
@@ -0,0 +1,7 @@
1
+ {
2
+ "attr-value-double-quotes": true,
3
+ "tag-pair": true,
4
+ "doctype-first": true,
5
+ "id-unique": true,
6
+ "spec-char-escape": true
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "default": true,
3
+ "MD003": { "style": "atx_closed" },
4
+ "MD007": { "indent": 4 },
5
+ "no-hard-tabs": false,
6
+ "whitespace": false
7
+ }