This is page 7 of 20. Use http://codebase.md/fujitsu-ai/mcp-server-for-mas-developments?lines=true&page={x} to view the full context. # Directory Structure ``` ├── .gitattributes ├── .gitignore ├── agents │ ├── __init__.py │ ├── AgentInterface │ │ ├── __init__.py │ │ ├── Python │ │ │ ├── __init__.py │ │ │ ├── agent.py │ │ │ ├── color.py │ │ │ ├── config.py │ │ │ ├── language.py │ │ │ ├── local_file_handler.py │ │ │ └── network.py │ │ └── requirements.txt │ ├── AgentMonitoring │ │ ├── ChatBot-Agent Dashboard Example - Grafana.json │ │ ├── images │ │ │ ├── Grafana.png │ │ │ └── Prometheus.png │ │ ├── IoT-Agent Dashboard Example - Grafana.json │ │ ├── OpenAI compatible API - Agent Dashboard Example - Grafana.json │ │ ├── prometheus Example.yml │ │ └── README.md │ ├── ChatBotAgent │ │ ├── __init__.py │ │ ├── config.json.example │ │ ├── html │ │ │ ├── favicon.ico │ │ │ ├── index_de.html │ │ │ ├── index.html │ │ │ ├── Logo_light.svg │ │ │ ├── start_http_server.ps1 │ │ │ └── start_http_server.sh │ │ ├── Python │ │ │ ├── __init__.py │ │ │ └── chatbot_agent.py │ │ ├── README.md │ │ └── requirements.txt │ ├── IoTAgent │ │ ├── config_example.json │ │ ├── Python │ │ │ ├── iot_mqtt_agent.py │ │ │ └── language.py │ │ ├── README.md │ │ └── requirements.txt │ ├── MCP-Client │ │ ├── __init__.py │ │ ├── .env.example │ │ ├── Python │ │ │ ├── __init__.py │ │ │ ├── chat_handler.py │ │ │ ├── config.py │ │ │ ├── environment.py │ │ │ ├── llm_client.py │ │ │ ├── mcp_client_sse.py │ │ │ ├── mcp_client.py │ │ │ ├── messages │ │ │ │ ├── __init__.py │ │ │ │ ├── message_types │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── incrementing_id_message.py │ │ │ │ │ ├── initialize_message.py │ │ │ │ │ ├── json_rpc_message.py │ │ │ │ │ ├── ping_message.py │ │ │ │ │ ├── prompts_messages.py │ │ │ │ │ ├── prompts_models.py │ │ │ │ │ ├── resources_messages.py │ │ │ │ │ └── tools_messages.py │ │ │ │ ├── send_call_tool.py │ │ │ │ ├── send_initialize_message.py │ │ │ │ ├── send_message.py │ │ │ │ ├── send_ping.py │ │ │ │ ├── send_prompts.py │ │ │ │ ├── send_resources.py │ │ │ │ └── send_tools_list.py │ │ │ ├── system_prompt_generator.py │ │ │ ├── tools_handler.py │ │ │ └── transport │ │ │ ├── __init__.py │ │ │ └── stdio │ │ │ ├── __init__.py │ │ │ ├── stdio_client.py │ │ │ ├── stdio_server_parameters.py │ │ │ └── stdio_server_shutdown.py │ │ ├── README.md │ │ ├── requirements.txt │ │ └── server_config.json │ ├── OpenAI_Compatible_API_Agent │ │ ├── __init__.py │ │ ├── docker-compose.yml │ │ ├── Dockerfile │ │ ├── pgpt_openai_api_mcp.json.example │ │ ├── pgpt_openai_api_proxy.json.example │ │ ├── Python │ │ │ ├── __init__.py │ │ │ ├── client_tests │ │ │ │ ├── __init__.py │ │ │ │ ├── openai_test_client_structured.py │ │ │ │ ├── openai_test_client_tools.py │ │ │ │ ├── openai_test_client.py │ │ │ │ ├── vllm_client_multimodal.py │ │ │ │ ├── vllm_client.py │ │ │ │ ├── vllm_structured.py │ │ │ │ └── vllm_structured2.py │ │ │ ├── generate_api_key.py │ │ │ ├── open_ai_helper.py │ │ │ ├── openai_compatible_api.py │ │ │ ├── openai_mcp_api.py │ │ │ ├── pgpt_api.py │ │ │ ├── privategpt_api.py │ │ │ └── vllmproxy.py │ │ ├── README.md │ │ └── requirements.txt │ └── SourceManagerAgent │ ├── __init__.py │ ├── config.json.example │ └── Python │ ├── __init__.py │ ├── file_tools │ │ └── loader_factory.py │ ├── file_upload_agent.py │ └── local_db.py ├── clients │ ├── __init__.py │ ├── C# .Net │ │ ├── 1.0 mcp_login │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_login.deps.json │ │ │ │ ├── mcp_login.dll │ │ │ │ ├── mcp_login.exe │ │ │ │ ├── mcp_login.pdb │ │ │ │ ├── mcp_login.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_login.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_login.AssemblyInfo.cs │ │ │ │ │ ├── mcp_login.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_login.assets.cache │ │ │ │ │ ├── mcp_login.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_login.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_login.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_login.csproj.Up2Date │ │ │ │ │ ├── mcp_login.dll │ │ │ │ │ ├── mcp_login.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_login.genruntimeconfig.cache │ │ │ │ │ ├── mcp_login.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_login.pdb │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_login.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_login.dll │ │ │ │ ├── mcp_login.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_login.csproj.nuget.g.props │ │ │ │ ├── mcp_login.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 1.1 mcp_logout │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_logout.deps.json │ │ │ │ ├── mcp_logout.dll │ │ │ │ ├── mcp_logout.exe │ │ │ │ ├── mcp_logout.pdb │ │ │ │ ├── mcp_logout.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_logout.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_logout.AssemblyInfo.cs │ │ │ │ │ ├── mcp_logout.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_logout.assets.cache │ │ │ │ │ ├── mcp_logout.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_logout.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_logout.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_logout.csproj.Up2Date │ │ │ │ │ ├── mcp_logout.dll │ │ │ │ │ ├── mcp_logout.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_logout.genruntimeconfig.cache │ │ │ │ │ ├── mcp_logout.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_logout.pdb │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_logout.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_logout.dll │ │ │ │ ├── mcp_logout.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_logout.csproj.nuget.g.props │ │ │ │ ├── mcp_logout.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 2.0 mcp_chat │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_chat.deps.json │ │ │ │ ├── mcp_chat.dll │ │ │ │ ├── mcp_chat.exe │ │ │ │ ├── mcp_chat.pdb │ │ │ │ ├── mcp_chat.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_chat.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_chat.AssemblyInfo.cs │ │ │ │ │ ├── mcp_chat.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_chat.assets.cache │ │ │ │ │ ├── mcp_chat.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_chat.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_chat.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_chat.csproj.Up2Date │ │ │ │ │ ├── mcp_chat.dll │ │ │ │ │ ├── mcp_chat.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_chat.genruntimeconfig.cache │ │ │ │ │ ├── mcp_chat.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_chat.pdb │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_chat.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_chat.dll │ │ │ │ ├── mcp_chat.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_chat.csproj.nuget.g.props │ │ │ │ ├── mcp_chat.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 2.1 mcp_continue_chat │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_continue_chat.deps.json │ │ │ │ ├── mcp_continue_chat.dll │ │ │ │ ├── mcp_continue_chat.exe │ │ │ │ ├── mcp_continue_chat.pdb │ │ │ │ ├── mcp_continue_chat.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_continue_chat.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_cont.EF178231.Up2Date │ │ │ │ │ ├── mcp_continue_chat.AssemblyInfo.cs │ │ │ │ │ ├── mcp_continue_chat.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_continue_chat.assets.cache │ │ │ │ │ ├── mcp_continue_chat.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_continue_chat.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_continue_chat.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_continue_chat.dll │ │ │ │ │ ├── mcp_continue_chat.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_continue_chat.genruntimeconfig.cache │ │ │ │ │ ├── mcp_continue_chat.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_continue_chat.pdb │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_continue_chat.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_continue_chat.dll │ │ │ │ ├── mcp_continue_chat.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_continue_chat.csproj.nuget.g.props │ │ │ │ ├── mcp_continue_chat.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 2.2 mcp_get_chat_info │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_get_chat_info.deps.json │ │ │ │ ├── mcp_get_chat_info.dll │ │ │ │ ├── mcp_get_chat_info.exe │ │ │ │ ├── mcp_get_chat_info.pdb │ │ │ │ ├── mcp_get_chat_info.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── Dokumente - Verknüpfung.lnk │ │ │ ├── mcp_get_chat_info.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_get_.DFF47B4E.Up2Date │ │ │ │ │ ├── mcp_get_chat_info.AssemblyInfo.cs │ │ │ │ │ ├── mcp_get_chat_info.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_get_chat_info.assets.cache │ │ │ │ │ ├── mcp_get_chat_info.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_get_chat_info.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_get_chat_info.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_get_chat_info.dll │ │ │ │ │ ├── mcp_get_chat_info.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_get_chat_info.genruntimeconfig.cache │ │ │ │ │ ├── mcp_get_chat_info.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_get_chat_info.pdb │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_get_chat_info.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_get_chat_info.dll │ │ │ │ ├── mcp_get_chat_info.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_get_chat_info.csproj.nuget.g.props │ │ │ │ ├── mcp_get_chat_info.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 3.0 mcp_create_source │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_create_source.deps.json │ │ │ │ ├── mcp_create_source.dll │ │ │ │ ├── mcp_create_source.exe │ │ │ │ ├── mcp_create_source.pdb │ │ │ │ ├── mcp_create_source.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_create_source.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_crea.CB4ED912.Up2Date │ │ │ │ │ ├── mcp_create_source.AssemblyInfo.cs │ │ │ │ │ ├── mcp_create_source.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_create_source.assets.cache │ │ │ │ │ ├── mcp_create_source.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_create_source.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_create_source.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_create_source.dll │ │ │ │ │ ├── mcp_create_source.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_create_source.genruntimeconfig.cache │ │ │ │ │ ├── mcp_create_source.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_create_source.pdb │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_create_source.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_create_source.dll │ │ │ │ ├── mcp_create_source.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_create_source.csproj.nuget.g.props │ │ │ │ ├── mcp_create_source.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 3.1 mcp_get_source │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_get_source.deps.json │ │ │ │ ├── mcp_get_source.dll │ │ │ │ ├── mcp_get_source.exe │ │ │ │ ├── mcp_get_source.pdb │ │ │ │ ├── mcp_get_source.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_get_source.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_get_.4E61956F.Up2Date │ │ │ │ │ ├── mcp_get_source.AssemblyInfo.cs │ │ │ │ │ ├── mcp_get_source.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_get_source.assets.cache │ │ │ │ │ ├── mcp_get_source.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_get_source.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_get_source.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_get_source.dll │ │ │ │ │ ├── mcp_get_source.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_get_source.genruntimeconfig.cache │ │ │ │ │ ├── mcp_get_source.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_get_source.pdb │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_get_source.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_get_source.dll │ │ │ │ ├── mcp_get_source.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_get_source.csproj.nuget.g.props │ │ │ │ ├── mcp_get_source.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 3.2 mcp_list_sources │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_list_sources.deps.json │ │ │ │ ├── mcp_list_sources.dll │ │ │ │ ├── mcp_list_sources.exe │ │ │ │ ├── mcp_list_sources.pdb │ │ │ │ ├── mcp_list_sources.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_list_sources.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_list_sources.AssemblyInfo.cs │ │ │ │ │ ├── mcp_list_sources.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_list_sources.assets.cache │ │ │ │ │ ├── mcp_list_sources.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_list_sources.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_list_sources.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_list_sources.dll │ │ │ │ │ ├── mcp_list_sources.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_list_sources.genruntimeconfig.cache │ │ │ │ │ ├── mcp_list_sources.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_list_sources.pdb │ │ │ │ │ ├── mcp_list.A720E197.Up2Date │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_list_sources.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_list_sources.dll │ │ │ │ ├── mcp_list_sources.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_list_sources.csproj.nuget.g.props │ │ │ │ ├── mcp_list_sources.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 3.3 mcp_edit_source │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_edit_source.deps.json │ │ │ │ ├── mcp_edit_source.dll │ │ │ │ ├── mcp_edit_source.exe │ │ │ │ ├── mcp_edit_source.pdb │ │ │ │ ├── mcp_edit_source.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_edit_source.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_edit_source.AssemblyInfo.cs │ │ │ │ │ ├── mcp_edit_source.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_edit_source.assets.cache │ │ │ │ │ ├── mcp_edit_source.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_edit_source.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_edit_source.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_edit_source.dll │ │ │ │ │ ├── mcp_edit_source.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_edit_source.genruntimeconfig.cache │ │ │ │ │ ├── mcp_edit_source.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_edit_source.pdb │ │ │ │ │ ├── mcp_edit.7303BE3B.Up2Date │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_edit_source.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_edit_source.dll │ │ │ │ ├── mcp_edit_source.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_edit_source.csproj.nuget.g.props │ │ │ │ ├── mcp_edit_source.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 3.4 mcp_delete_source │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_delete_source.deps.json │ │ │ │ ├── mcp_delete_source.dll │ │ │ │ ├── mcp_delete_source.exe │ │ │ │ ├── mcp_delete_source.pdb │ │ │ │ ├── mcp_delete_source.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_delete_source.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_dele.67DD13F9.Up2Date │ │ │ │ │ ├── mcp_delete_source.AssemblyInfo.cs │ │ │ │ │ ├── mcp_delete_source.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_delete_source.assets.cache │ │ │ │ │ ├── mcp_delete_source.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_delete_source.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_delete_source.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_delete_source.dll │ │ │ │ │ ├── mcp_delete_source.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_delete_source.genruntimeconfig.cache │ │ │ │ │ ├── mcp_delete_source.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_delete_source.pdb │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_delete_source.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_delete_source.dll │ │ │ │ ├── mcp_delete_source.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_delete_source.csproj.nuget.g.props │ │ │ │ ├── mcp_delete_source.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 4.0 mcp_list_groups │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_list_groups.deps.json │ │ │ │ ├── mcp_list_groups.dll │ │ │ │ ├── mcp_list_groups.exe │ │ │ │ ├── mcp_list_groups.pdb │ │ │ │ ├── mcp_list_groups.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_list_groups.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_list_groups.AssemblyInfo.cs │ │ │ │ │ ├── mcp_list_groups.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_list_groups.assets.cache │ │ │ │ │ ├── mcp_list_groups.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_list_groups.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_list_groups.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_list_groups.dll │ │ │ │ │ ├── mcp_list_groups.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_list_groups.genruntimeconfig.cache │ │ │ │ │ ├── mcp_list_groups.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_list_groups.pdb │ │ │ │ │ ├── mcp_list.EBD5E0D2.Up2Date │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_list_groups.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_list_groups.dll │ │ │ │ ├── mcp_list_groups.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_list_groups.csproj.nuget.g.props │ │ │ │ ├── mcp_list_groups.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 4.1 mcp_store_group │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_store_group.deps.json │ │ │ │ ├── mcp_store_group.dll │ │ │ │ ├── mcp_store_group.exe │ │ │ │ ├── mcp_store_group.pdb │ │ │ │ ├── mcp_store_group.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_store_group.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_stor.AFB4AA35.Up2Date │ │ │ │ │ ├── mcp_store_group.AssemblyInfo.cs │ │ │ │ │ ├── mcp_store_group.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_store_group.assets.cache │ │ │ │ │ ├── mcp_store_group.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_store_group.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_store_group.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_store_group.dll │ │ │ │ │ ├── mcp_store_group.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_store_group.genruntimeconfig.cache │ │ │ │ │ ├── mcp_store_group.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_store_group.pdb │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_store_group.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_store_group.dll │ │ │ │ ├── mcp_store_group.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_store_group.csproj.nuget.g.props │ │ │ │ ├── mcp_store_group.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 4.2 mcp_delete_group │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_delete_group.deps.json │ │ │ │ ├── mcp_delete_group.dll │ │ │ │ ├── mcp_delete_group.exe │ │ │ │ ├── mcp_delete_group.pdb │ │ │ │ ├── mcp_delete_group.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_delete_group.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_dele.FE1C6298.Up2Date │ │ │ │ │ ├── mcp_delete_group.AssemblyInfo.cs │ │ │ │ │ ├── mcp_delete_group.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_delete_group.assets.cache │ │ │ │ │ ├── mcp_delete_group.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_delete_group.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_delete_group.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_delete_group.dll │ │ │ │ │ ├── mcp_delete_group.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_delete_group.genruntimeconfig.cache │ │ │ │ │ ├── mcp_delete_group.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_delete_group.pdb │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_delete_group.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_delete_group.dll │ │ │ │ ├── mcp_delete_group.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_delete_group.csproj.nuget.g.props │ │ │ │ ├── mcp_delete_group.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 5.0 mcp_store_user │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_store_user.deps.json │ │ │ │ ├── mcp_store_user.dll │ │ │ │ ├── mcp_store_user.exe │ │ │ │ ├── mcp_store_user.pdb │ │ │ │ ├── mcp_store_user.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_store_user.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_stor.6C0F0C8A.Up2Date │ │ │ │ │ ├── mcp_store_user.AssemblyInfo.cs │ │ │ │ │ ├── mcp_store_user.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_store_user.assets.cache │ │ │ │ │ ├── mcp_store_user.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_store_user.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_store_user.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_store_user.dll │ │ │ │ │ ├── mcp_store_user.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_store_user.genruntimeconfig.cache │ │ │ │ │ ├── mcp_store_user.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_store_user.pdb │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_store_user.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_store_user.dll │ │ │ │ ├── mcp_store_user.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_store_user.csproj.nuget.g.props │ │ │ │ ├── mcp_store_user.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 5.1 mcp_edit_user │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_edit_user.deps.json │ │ │ │ ├── mcp_edit_user.dll │ │ │ │ ├── mcp_edit_user.exe │ │ │ │ ├── mcp_edit_user.pdb │ │ │ │ ├── mcp_edit_user.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_edit_user.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_edit_user.AssemblyInfo.cs │ │ │ │ │ ├── mcp_edit_user.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_edit_user.assets.cache │ │ │ │ │ ├── mcp_edit_user.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_edit_user.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_edit_user.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_edit_user.dll │ │ │ │ │ ├── mcp_edit_user.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_edit_user.genruntimeconfig.cache │ │ │ │ │ ├── mcp_edit_user.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_edit_user.pdb │ │ │ │ │ ├── mcp_edit.94A30270.Up2Date │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_edit_user.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_edit_user.dll │ │ │ │ ├── mcp_edit_user.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_edit_user.csproj.nuget.g.props │ │ │ │ ├── mcp_edit_user.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── 5.2 mcp_delete_user │ │ │ ├── bin │ │ │ │ └── Debug │ │ │ │ └── net9.0 │ │ │ │ ├── mcp_delete_user.deps.json │ │ │ │ ├── mcp_delete_user.dll │ │ │ │ ├── mcp_delete_user.exe │ │ │ │ ├── mcp_delete_user.pdb │ │ │ │ ├── mcp_delete_user.runtimeconfig.json │ │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── mcp_delete_user.csproj │ │ │ ├── obj │ │ │ │ ├── Debug │ │ │ │ │ └── net9.0 │ │ │ │ │ ├── .NETCoreApp,Version=v9.0.AssemblyAttributes.cs │ │ │ │ │ ├── apphost.exe │ │ │ │ │ ├── mcp_dele.CEB7E33D.Up2Date │ │ │ │ │ ├── mcp_delete_user.AssemblyInfo.cs │ │ │ │ │ ├── mcp_delete_user.AssemblyInfoInputs.cache │ │ │ │ │ ├── mcp_delete_user.assets.cache │ │ │ │ │ ├── mcp_delete_user.csproj.AssemblyReference.cache │ │ │ │ │ ├── mcp_delete_user.csproj.CoreCompileInputs.cache │ │ │ │ │ ├── mcp_delete_user.csproj.FileListAbsolute.txt │ │ │ │ │ ├── mcp_delete_user.dll │ │ │ │ │ ├── mcp_delete_user.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ │ ├── mcp_delete_user.genruntimeconfig.cache │ │ │ │ │ ├── mcp_delete_user.GlobalUsings.g.cs │ │ │ │ │ ├── mcp_delete_user.pdb │ │ │ │ │ ├── ref │ │ │ │ │ │ └── mcp_delete_user.dll │ │ │ │ │ └── refint │ │ │ │ │ └── mcp_delete_user.dll │ │ │ │ ├── mcp_delete_user.csproj.nuget.dgspec.json │ │ │ │ ├── mcp_delete_user.csproj.nuget.g.props │ │ │ │ ├── mcp_delete_user.csproj.nuget.g.targets │ │ │ │ ├── project.assets.json │ │ │ │ └── project.nuget.cache │ │ │ └── Program.cs │ │ ├── Code Archiv │ │ │ ├── mcp_chat.cs │ │ │ ├── mcp_continue_chat.cs │ │ │ ├── mcp_create_source.cs │ │ │ ├── mcp_delete_group.cs │ │ │ ├── mcp_delete_source.cs │ │ │ ├── mcp_delete_user.cs │ │ │ ├── mcp_edit_source.cs │ │ │ ├── mcp_edit_user.cs │ │ │ ├── mcp_get_chat_info.cs │ │ │ ├── mcp_get_source.cs │ │ │ ├── mcp_list_groups.cs │ │ │ ├── mcp_list_sources.cs │ │ │ ├── mcp_login.cs │ │ │ ├── mcp_logout.cs │ │ │ ├── mcp_store_group.cs │ │ │ └── mcp_store_user.cs │ │ └── README.md │ ├── C++ │ │ ├── .vscode │ │ │ └── launch.json │ │ ├── 1.0 mcp_login │ │ │ ├── MCPLoginClient.cpp │ │ │ └── Non-TLS version │ │ │ ├── MCPLoginClient.cpp │ │ │ └── MCPLoginClient.exe │ │ ├── 1.1 mcp_logout │ │ │ ├── MCPLogoutClient.cpp │ │ │ └── MCPLogoutClient.exe │ │ ├── 2.0 mcp_chat │ │ │ ├── MCPChatClient.cpp │ │ │ └── MCPChatClient.exe │ │ ├── 2.1 mcp_continue_chat │ │ │ ├── MCPChatContinuationClient.cpp │ │ │ └── MCPChatContinuationClient.exe │ │ ├── 2.2 mcp_get_chat_info │ │ │ ├── MCPGetChatInfoClient.cpp │ │ │ └── MCPGetChatInfoClient.exe │ │ ├── 3.0 mcp_create_source │ │ │ ├── MCPCreateSourceClient.cpp │ │ │ └── MCPCreateSourceClient.exe │ │ ├── 3.1 mcp_get_source │ │ │ ├── MCPGetSourceClient.cpp │ │ │ └── MCPGetSourceClient.exe │ │ ├── 3.2 mcp_list_sources │ │ │ ├── MCPListSourcesClient.cpp │ │ │ └── MCPListSourcesClient.exe │ │ ├── 3.3 mcp_edit_source │ │ │ ├── MCPEditSourceClient.cpp │ │ │ └── MCPEditSourceClient.exe │ │ ├── 3.4 mcp_delete_source │ │ │ ├── MCPDeleteSourceClient.cpp │ │ │ └── MCPDeleteSourceClient.exe │ │ ├── 4.0 mcp_list_groups │ │ │ ├── MCPListGroupsClient.cpp │ │ │ └── MCPListGroupsClient.exe │ │ ├── 4.1 mcp_store_group │ │ │ ├── MCPStoreGroupClient.cpp │ │ │ └── MCPStoreGroupClient.exe │ │ ├── 4.2 mcp_delete_group │ │ │ ├── MPCDeleteGroupClient.cpp │ │ │ └── MPCDeleteGroupClient.exe │ │ ├── 5.0 mcp_store_user │ │ │ ├── MCPStoreUserClient.cpp │ │ │ └── MCPStoreUserClient.exe │ │ ├── 5.1 mcp_edit_user │ │ │ ├── MCPEditUserClient.cpp │ │ │ └── MCPEditUserClient.exe │ │ ├── 5.2 mcp_delete_user │ │ │ ├── MCPDeleteUserClient.cpp │ │ │ └── MCPDeleteUserClient.exe │ │ ├── 9.0 mcp_keygen │ │ │ ├── MCPKeygenClient.cpp │ │ │ └── MCPKeygenClient.exe │ │ └── README.md │ ├── Go │ │ ├── 1.0 mcp_login │ │ │ ├── go.mod │ │ │ ├── MCPLoginClient.exe │ │ │ └── MCPLoginClient.go │ │ ├── 1.1 mcp_logout │ │ │ ├── MCPLogoutClient.exe │ │ │ └── MCPLogoutClient.go │ │ ├── 2.0 mcp_chat │ │ │ ├── MCPChatClient.exe │ │ │ └── MCPChatClient.go │ │ ├── 2.1 mcp_continue_chat │ │ │ ├── MCPChatContinuationClient.exe │ │ │ └── MCPChatContinuationClient.go │ │ ├── 2.2 mcp_get_chat_info │ │ │ ├── MCPGetChatInfoClient.exe │ │ │ └── MCPGetChatInfoClient.go │ │ ├── 3.0 mcp_create_source │ │ │ ├── MCPCreateSourceClient.exe │ │ │ └── MCPCreateSourceClient.go │ │ ├── 3.1 mcp_get_source │ │ │ ├── MCPGetSourceClient.exe │ │ │ └── MCPGetSourceClient.go │ │ ├── 3.2 mcp_list_sources │ │ │ ├── MCPListSourcesClient.exe │ │ │ └── MCPListSourcesClient.go │ │ ├── 3.3 mcp_edit_source │ │ │ ├── MCPEditSourceClient.exe │ │ │ └── MCPEditSourceClient.go │ │ ├── 3.4 mcp_delete_source │ │ │ ├── MCPDeleteSourceClient.exe │ │ │ └── MCPDeleteSourceClient.go │ │ ├── 4.0 mcp_list_groups │ │ │ ├── MCPListGroupsClient.exe │ │ │ └── MCPListGroupsClient.go │ │ ├── 4.1 mcp_store_group │ │ │ ├── MCPStoreGroupClient.exe │ │ │ └── MCPStoreGroupClient.go │ │ ├── 4.2 mcp_delete_group │ │ │ ├── MCPDeleteGroupClient.exe │ │ │ └── MCPDeleteGroupClient.go │ │ ├── 5.0 mcp_store_user │ │ │ ├── MCPStoreUserClient.exe │ │ │ └── MCPStoreUserClient.go │ │ ├── 5.1 mcp_edit_user │ │ │ ├── MCPEditUserClient.exe │ │ │ └── MCPEditUserClient.go │ │ ├── 5.2 mcp_delete_user │ │ │ ├── MCPDeleteUserClient.exe │ │ │ └── MCPDeleteUserClient.go │ │ ├── 9.0 mcp_keygen │ │ │ ├── MCPKeygenClient.exe │ │ │ └── MCPKeygenClient.go │ │ └── README.md │ ├── Gradio │ │ ├── Api.py │ │ ├── config.json.example │ │ ├── config.py │ │ ├── favicon.ico │ │ ├── file_tools │ │ │ └── loader_factory.py │ │ ├── language.py │ │ ├── logos │ │ │ ├── fsas.png │ │ │ └── Logo_dark.svg │ │ ├── main.py │ │ ├── mcp_client.py │ │ ├── mcp_servers │ │ │ ├── arxiv │ │ │ │ ├── arxiv-stdio.js │ │ │ │ ├── package.json │ │ │ │ ├── README.md │ │ │ │ ├── requirements.txt │ │ │ │ └── server_config.example.json │ │ │ ├── demo-mcp-server │ │ │ │ ├── demo-tools-sse.js │ │ │ │ ├── demo-tools-stdio.js │ │ │ │ └── tools │ │ │ │ ├── assets.js │ │ │ │ ├── calculator.js │ │ │ │ └── weather.js │ │ │ ├── filesystem │ │ │ │ ├── Dockerfile │ │ │ │ ├── index.ts │ │ │ │ ├── package.json │ │ │ │ ├── README.md │ │ │ │ ├── test │ │ │ │ │ └── new.txt │ │ │ │ └── tsconfig.json │ │ │ ├── moondream │ │ │ │ └── server.py │ │ │ ├── pgpt │ │ │ │ ├── __init__.py │ │ │ │ ├── Api.py │ │ │ │ ├── config.json.example │ │ │ │ ├── config.py │ │ │ │ ├── language.py │ │ │ │ ├── pyproject.toml │ │ │ │ ├── README.md │ │ │ │ └── server.py │ │ │ ├── replicate_flux │ │ │ │ └── server.py │ │ │ └── sqlite │ │ │ ├── .python-version │ │ │ ├── Dockerfile │ │ │ ├── pyproject.toml │ │ │ ├── README.md │ │ │ └── src │ │ │ └── mcp_server_sqlite │ │ │ ├── __init__.py │ │ │ └── server.py │ │ ├── messages │ │ │ ├── __init__.py │ │ │ ├── message_types │ │ │ │ ├── __init__.py │ │ │ │ ├── incrementing_id_message.py │ │ │ │ ├── initialize_message.py │ │ │ │ ├── json_rpc_message.py │ │ │ │ ├── ping_message.py │ │ │ │ ├── prompts_messages.py │ │ │ │ ├── prompts_models.py │ │ │ │ ├── resources_messages.py │ │ │ │ └── tools_messages.py │ │ │ ├── send_call_tool.py │ │ │ ├── send_initialize_message.py │ │ │ ├── send_message.py │ │ │ ├── send_ping.py │ │ │ ├── send_prompts.py │ │ │ ├── send_resources.py │ │ │ └── send_tools_list.py │ │ ├── README.md │ │ ├── requirements.txt │ │ ├── server_config.json │ │ ├── SourceManagement.py │ │ ├── transport │ │ │ ├── __init__.py │ │ │ └── stdio │ │ │ ├── __init__.py │ │ │ ├── stdio_client.py │ │ │ ├── stdio_server_parameters.py │ │ │ └── stdio_server_shutdown.py │ │ ├── tsconfig.json │ │ └── UserManagement.py │ ├── Java │ │ ├── 1.0 mcp_login │ │ │ ├── json-20241224.jar │ │ │ ├── MCPLoginClient.class │ │ │ └── MCPLoginClient.java │ │ ├── 1.1 mcp_logout │ │ │ ├── json-20241224.jar │ │ │ ├── MCPLogoutClient.class │ │ │ └── MCPLogoutClient.java │ │ ├── 2.0 mcp_chat │ │ │ ├── json-20241224.jar │ │ │ ├── MCPChatClient.class │ │ │ └── MCPChatClient.java │ │ ├── 2.1 mcp_continue_chat │ │ │ ├── json-20241224.jar │ │ │ ├── MCPContinueChatClient.class │ │ │ └── MCPContinueChatClient.java │ │ ├── 2.2 mcp_get_chat_info │ │ │ ├── json-20241224.jar │ │ │ ├── MCPGetChatInfoClient.class │ │ │ └── MCPGetChatInfoClient.java │ │ ├── 3.0 mcp_create_source │ │ │ ├── json-20241224.jar │ │ │ ├── MCPCreateSourceClient.class │ │ │ └── MCPCreateSourceClient.java │ │ ├── 3.1 mcp_get_source │ │ │ ├── json-20241224.jar │ │ │ ├── MCPGetSourceClient.class │ │ │ └── MCPGetSourceClient.java │ │ ├── 3.2 mcp_list_sources │ │ │ ├── json-20241224.jar │ │ │ ├── MCPListSourcesClient.class │ │ │ └── MCPListSourcesClient.java │ │ ├── 3.3 mcp_edit_source │ │ │ ├── json-20241224.jar │ │ │ ├── MCPEditSourceClient.class │ │ │ └── MCPEditSourceClient.java │ │ ├── 3.4 mcp_delete_source │ │ │ ├── json-20241224.jar │ │ │ ├── MCPDeleteSourceClient.class │ │ │ └── MCPDeleteSourceClient.java │ │ ├── 4.0 mcp_list_groups │ │ │ ├── json-20241224.jar │ │ │ ├── MCPListGroupsClient.class │ │ │ └── MCPListGroupsClient.java │ │ ├── 4.1 mcp_store_group │ │ │ ├── json-20241224.jar │ │ │ ├── MCPStoreGroupClient.class │ │ │ └── MCPStoreGroupClient.java │ │ ├── 4.2 mcp_delete_group │ │ │ ├── json-20241224.jar │ │ │ ├── MCPDeleteGroupClient.class │ │ │ └── MCPDeleteGroupClient.java │ │ ├── 5.0 mcp_store_user │ │ │ ├── json-20241224.jar │ │ │ ├── MCPStoreUserClient.class │ │ │ └── MCPStoreUserClient.java │ │ ├── 5.1 mcp_edit_user │ │ │ ├── json-20241224.jar │ │ │ ├── MCPEditUserClient.class │ │ │ └── MCPEditUserClient.java │ │ ├── 5.2 mcp_delete_user │ │ │ ├── json-20241224.jar │ │ │ ├── MCPDeleteUserClient.class │ │ │ └── MCPDeleteUserClient.java │ │ └── README.md │ ├── JavaScript │ │ ├── 1.0 mcp_login │ │ │ └── MCPLoginClient.js │ │ ├── 1.1 mcp_logout │ │ │ └── MCPLogoutClient.js │ │ ├── 2.0 mcp_chat │ │ │ └── MCPChatClient.js │ │ ├── 2.1 mcp_continue_chat │ │ │ └── MCPContinueChatClient.js │ │ ├── 2.2 mcp_get_chat_info │ │ │ └── MCPGetChatInfoClient.js │ │ ├── 3.0 mcp_create_source │ │ │ └── MCPCreateSourceClient.js │ │ ├── 3.1 mcp_get_source │ │ │ └── MCPGetSourceClient.js │ │ ├── 3.2 mcp_list_sources │ │ │ └── MCPListSourcesClient.js │ │ ├── 3.3 mcp_edit_source │ │ │ └── MCPEditSourceClient.js │ │ ├── 3.4 mcp_delete_source │ │ │ └── MCPDeleteSourceClient.js │ │ ├── 4.0 mcp_list_groups │ │ │ └── MCPListGroupsClient.js │ │ ├── 4.1 mcp_store_group │ │ │ └── MCPStoreGroupClient.js │ │ ├── 4.2 mcp_delete_group │ │ │ └── MCPDeleteGroupClient.js │ │ ├── 5.0 mcp_store_user │ │ │ └── MCPStoreUserClient.js │ │ ├── 5.1 mcp_edit_user │ │ │ └── MCPEditUserClient.js │ │ ├── 5.2 mcp_delete_user │ │ │ └── MCPDeleteUserClient.js │ │ ├── 9.0 mcp_keygen │ │ │ └── MCPKeygenClient.js │ │ └── README.md │ ├── PHP │ │ ├── 1.0 mcp_login │ │ │ └── MCPLoginClient.php │ │ ├── 1.1 mcp_logout │ │ │ └── MCPLogoutClient.php │ │ ├── 2.0 mcp_chat │ │ │ └── MCPChatClient.php │ │ ├── 2.1 mcp_continue_chat │ │ │ └── MCPContinueChatClient.php │ │ ├── 2.2 mcp_get_chat_info │ │ │ └── MCPGetChatInfoClient.php │ │ ├── 3.0 mcp_create_source │ │ │ └── MCPCreateSourceClient.php │ │ ├── 3.1 mcp_get_source │ │ │ └── MCPGetSourceClient.php │ │ ├── 3.2 mcp_list_sources │ │ │ └── MCPListSourcesClient.php │ │ ├── 3.3 mcp_edit_source │ │ │ └── MCPEditSourceClient.php │ │ ├── 3.4 mcp_delete_source │ │ │ └── MCPDeleteSourceClient.php │ │ ├── 4.0 mcp_list_groups │ │ │ └── MCPListGroupsClient.php │ │ ├── 4.1 mcp_store_group │ │ │ └── MCPStoreGroupClient.php │ │ ├── 4.2 mcp_delete_group │ │ │ └── MCPDeleteGroupClient.php │ │ ├── 5.0 mcp_store_user │ │ │ └── MCPStoreUserClient.php │ │ ├── 5.1 mcp_edit_user │ │ │ └── MCPEditUserClient.php │ │ ├── 5.2 mcp_delete_user │ │ │ └── MCPDeleteUserClient.php │ │ ├── 9.0 mcp_keygen │ │ │ └── MCPKeygenClient.php │ │ └── README.md │ └── Python │ ├── __init__.py │ ├── 1.0 mcp_login │ │ └── MCPLoginClient.py │ ├── 1.1 mcp_logout │ │ └── MCPLogoutClient.py │ ├── 2.0 mcp_chat │ │ └── MCPChatClient.py │ ├── 2.1 mcp_continue_chat │ │ └── MCPContinueChatClient.py │ ├── 2.2 mcp_get_chat_info │ │ └── MCPGetChatInfoClient.py │ ├── 2.3 mcp_delete_all_chats │ │ └── MCPDeleteAllChatsClient.py │ ├── 2.4 mcp_delete_chat │ │ └── MCPDeleteChatClient.py │ ├── 3.0 mcp_create_source │ │ └── MCPCreateSourceClient.py │ ├── 3.1 mcp_get_source │ │ └── MCPGetSourceClient.py │ ├── 3.2 mcp_list_sources │ │ └── MCPListSourcesClient.py │ ├── 3.3 mcp_edit_source │ │ └── MCPEditSourceClient.py │ ├── 3.4 mcp_delete_source │ │ └── MCPDeleteSourceClient.py │ ├── 4.0 mcp_list_groups │ │ └── MCPListGroupsClient.py │ ├── 4.1 mcp_store_group │ │ └── MCPStoreGroupClient.py │ ├── 4.2 mcp_delete_group │ │ └── MCPDeleteGroupClient.py │ ├── 5.0 mcp_store_user │ │ └── MCPStoreUserClient.py │ ├── 5.1 mcp_edit_user │ │ └── MCPEditUserClient.py │ ├── 5.2 mcp_delete_user │ │ └── MCPDeleteUserClient.py │ ├── 9.0 mcp_keygen │ │ └── MCPKeygenClient.py │ ├── Gradio │ │ ├── __init__.py │ │ └── server_config.json │ └── README.md ├── examples │ ├── create_users_from_csv │ │ ├── config.json.example │ │ ├── config.py │ │ ├── create_users_from_csv.py │ │ └── language.py │ ├── dynamic_sources │ │ └── rss_reader │ │ ├── Api.py │ │ ├── config.json.example │ │ ├── config.py │ │ ├── demo_dynamic_sources.py │ │ └── rss_parser.py │ ├── example_users_to_add_no_tz.csv │ └── sftp_upload_with_id │ ├── Api.py │ ├── config_ftp.json.example │ ├── config.py │ ├── demo_upload.py │ ├── language.py │ └── requirements.txt ├── images │ ├── alternative mcp client.png │ ├── favicon │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-512x512.png │ │ ├── apple-touch-icon.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ └── site.webmanifest │ ├── mcp-general-architecture.png │ ├── privateGPT-MCP.png │ └── privateGPT.png ├── InstallMPCServer.sh ├── jest.config.js ├── LICENSE ├── package.json ├── pgpt.env.json.example ├── README.md ├── security │ ├── generate_decrypted_password.js │ └── generate_encrypted_password.js ├── src │ ├── helper.js │ ├── index.js │ ├── logger.js │ ├── pgpt-messages.js │ ├── public │ │ ├── index.html │ │ └── pgpt-mcp-logo.png │ ├── services │ │ └── pgpt-service.ts │ └── types │ └── api.ts ├── start_chatbot_agent.ps1 ├── start_chatbot_agent.sh ├── start_iot_agent.ps1 ├── start_iot_agent.sh ├── start_openai_compatible_api_agent.ps1 ├── start_openai_compatible_api_agent.sh ├── tsconfig.json ├── ver │ ├── index_np.js │ └── index_proxy_np.js └── WORKLOG.md ``` # Files -------------------------------------------------------------------------------- /agents/MCP-Client/Python/messages/send_initialize_message.py: -------------------------------------------------------------------------------- ```python 1 | # messages/send_initialize_message.py 2 | import logging 3 | import anyio 4 | from typing import Optional 5 | from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream 6 | 7 | from ..messages.message_types.initialize_message import ( 8 | InitializeMessage, 9 | InitializedNotificationMessage, 10 | InitializeParams, 11 | MCPClientCapabilities, 12 | MCPClientInfo, 13 | InitializeResult, 14 | ) 15 | 16 | 17 | async def send_initialize( 18 | read_stream: MemoryObjectReceiveStream, 19 | write_stream: MemoryObjectSendStream, 20 | ) -> Optional[InitializeResult]: 21 | """Send an initialization request to the server and process its response.""" 22 | 23 | # Set initialize params 24 | init_params = InitializeParams( 25 | protocolVersion="2024-11-05", 26 | capabilities=MCPClientCapabilities(), 27 | clientInfo=MCPClientInfo(), 28 | ) 29 | 30 | # Create the initialize message 31 | init_message = InitializeMessage(init_params) 32 | 33 | # Sending 34 | logging.debug("Sending initialize request") 35 | await write_stream.send(init_message) 36 | 37 | try: 38 | # 5-second timeout for response 39 | with anyio.fail_after(20): 40 | # Get the response from the server 41 | async for response in read_stream: 42 | # If the response is an exception, log it and continue 43 | if isinstance(response, Exception): 44 | logging.error(f"Error from server: {response}") 45 | continue 46 | 47 | # Debug log the received message 48 | logging.debug(f"Received: {response.model_dump()}") 49 | 50 | # Check for error 51 | if response.error: 52 | logging.error(f"Server initialization error: {response.error}") 53 | return None 54 | 55 | # Check for result 56 | if response.result: 57 | try: 58 | # Validate the result 59 | init_result = InitializeResult.model_validate(response.result) 60 | logging.debug("Server initialized successfully") 61 | 62 | # Notify the server of successful initialization 63 | initialized_notify = InitializedNotificationMessage() 64 | await write_stream.send(initialized_notify) 65 | 66 | return init_result 67 | except Exception as e: 68 | logging.error(f"Error processing init result: {e}") 69 | return None 70 | 71 | except TimeoutError: 72 | logging.error("Timeout waiting for server initialization response") 73 | return None 74 | except Exception as e: 75 | logging.error(f"Unexpected error during server initialization: {e}") 76 | raise 77 | 78 | # Timeout 79 | logging.error("Initialization response timeout") 80 | return None 81 | ``` -------------------------------------------------------------------------------- /clients/Gradio/messages/send_initialize_message.py: -------------------------------------------------------------------------------- ```python 1 | # messages/send_initialize_message.py 2 | import logging 3 | import anyio 4 | from typing import Optional 5 | from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream 6 | 7 | from ..messages.message_types.initialize_message import ( 8 | InitializeMessage, 9 | InitializedNotificationMessage, 10 | InitializeParams, 11 | MCPClientCapabilities, 12 | MCPClientInfo, 13 | InitializeResult, 14 | ) 15 | 16 | 17 | async def send_initialize( 18 | read_stream: MemoryObjectReceiveStream, 19 | write_stream: MemoryObjectSendStream, 20 | ) -> Optional[InitializeResult]: 21 | """Send an initialization request to the server and process its response.""" 22 | 23 | # Set initialize params 24 | init_params = InitializeParams( 25 | protocolVersion="2024-11-05", 26 | capabilities=MCPClientCapabilities(), 27 | clientInfo=MCPClientInfo(), 28 | ) 29 | 30 | # Create the initialize message 31 | init_message = InitializeMessage(init_params) 32 | 33 | # Sending 34 | logging.debug("Sending initialize request") 35 | await write_stream.send(init_message) 36 | 37 | try: 38 | # 5-second timeout for response 39 | with anyio.fail_after(20): 40 | # Get the response from the server 41 | async for response in read_stream: 42 | # If the response is an exception, log it and continue 43 | if isinstance(response, Exception): 44 | logging.error(f"Error from server: {response}") 45 | continue 46 | 47 | # Debug log the received message 48 | logging.debug(f"Received: {response.model_dump()}") 49 | 50 | # Check for error 51 | if response.error: 52 | logging.error(f"Server initialization error: {response.error}") 53 | return None 54 | 55 | # Check for result 56 | if response.result: 57 | try: 58 | # Validate the result 59 | init_result = InitializeResult.model_validate(response.result) 60 | logging.debug("Server initialized successfully") 61 | 62 | # Notify the server of successful initialization 63 | initialized_notify = InitializedNotificationMessage() 64 | await write_stream.send(initialized_notify) 65 | 66 | return init_result 67 | except Exception as e: 68 | logging.error(f"Error processing init result: {e}") 69 | return None 70 | 71 | except TimeoutError: 72 | logging.error("Timeout waiting for server initialization response") 73 | return None 74 | except Exception as e: 75 | logging.error(f"Unexpected error during server initialization: {e}") 76 | raise 77 | 78 | # Timeout 79 | logging.error("Initialization response timeout") 80 | return None 81 | ``` -------------------------------------------------------------------------------- /clients/Python/4.0 mcp_list_groups/MCPListGroupsClient.py: -------------------------------------------------------------------------------- ```python 1 | import socket 2 | import ssl 3 | import json 4 | import argparse 5 | 6 | def send_request(server_ip, server_port, payload, use_ssl=True, accept_self_signed=False): 7 | """ 8 | Sends a generic request to the server. 9 | """ 10 | payload_json = json.dumps(payload) 11 | 12 | raw_socket = None 13 | client_socket = None 14 | 15 | try: 16 | raw_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 17 | raw_socket.settimeout(10) 18 | 19 | if use_ssl: 20 | context = ssl.create_default_context() 21 | if accept_self_signed: 22 | context.check_hostname = False 23 | context.verify_mode = ssl.CERT_NONE 24 | client_socket = context.wrap_socket(raw_socket, server_hostname=server_ip) 25 | else: 26 | client_socket = raw_socket 27 | 28 | client_socket.connect((server_ip, server_port)) 29 | client_socket.sendall(payload_json.encode('utf-8')) 30 | 31 | response = b"" 32 | while True: 33 | part = client_socket.recv(4096) 34 | if not part: 35 | break 36 | response += part 37 | 38 | return json.loads(response.decode('utf-8')) 39 | except ssl.SSLError: 40 | return {"status": "error", "message": "Connection failed: Server and/or client may require TLS encryption. Please enable SSL/TLS."} 41 | except Exception as e: 42 | return {"status": "error", "message": str(e)} 43 | 44 | finally: 45 | if client_socket is not None: 46 | try: 47 | client_socket.shutdown(socket.SHUT_RDWR) 48 | except: 49 | pass 50 | client_socket.close() 51 | 52 | def list_groups(server_ip, server_port, token, use_ssl=True, accept_self_signed=False): 53 | """ 54 | Sends a request to the server to list groups. 55 | """ 56 | payload = { 57 | "command": "list_groups", 58 | "token": token 59 | } 60 | return send_request(server_ip, server_port, payload, use_ssl, accept_self_signed) 61 | 62 | if __name__ == "__main__": 63 | parser = argparse.ArgumentParser(description="List groups using MCP server.") 64 | parser.add_argument("--server-ip", required=True, help="IP address of the MCP server") 65 | parser.add_argument("--server-port", required=True, type=int, help="Port number of the MCP server") 66 | parser.add_argument("--token", required=True, help="Authentication token for the MCP server") 67 | parser.add_argument("--use-ssl", action="store_true", help="Connect using SSL/TLS") 68 | parser.add_argument("--accept-self-signed", action="store_true", help="Accept self-signed certificates (disable certificate verification)") 69 | 70 | args = parser.parse_args() 71 | 72 | print("📄 Retrieving groups...") 73 | response = list_groups(args.server_ip, args.server_port, args.token, use_ssl=args.use_ssl, accept_self_signed=args.accept_self_signed) 74 | print("✔️ Response:", response) 75 | ``` -------------------------------------------------------------------------------- /clients/C# .Net/2.1 mcp_continue_chat/Program.cs: -------------------------------------------------------------------------------- ```csharp 1 | using System; 2 | using System.Net.Sockets; 3 | using System.Text; 4 | using Newtonsoft.Json; 5 | 6 | namespace MCPChatContinuationClient 7 | { 8 | class Program 9 | { 10 | static void Main(string[] args) 11 | { 12 | if (args.Length < 6) 13 | { 14 | Console.WriteLine("Usage: --server-ip <IP> --server-port <PORT> --token <TOKEN> --conversation-id <ID> --message <MESSAGE>"); 15 | return; 16 | } 17 | 18 | string serverIp = GetArgument(args, "--server-ip"); 19 | int serverPort = int.Parse(GetArgument(args, "--server-port")); 20 | string token = GetArgument(args, "--token"); 21 | string conversationId = GetArgument(args, "--conversation-id"); 22 | string message = GetArgument(args, "--message"); 23 | 24 | var payload = new 25 | { 26 | command = "continue_chat", 27 | token = token, 28 | arguments = new 29 | { 30 | chatId = conversationId, 31 | question = message 32 | } 33 | }; 34 | 35 | Console.WriteLine("📤 Sending request to continue chat..."); 36 | string response = SendRequest(serverIp, serverPort, payload); 37 | Console.WriteLine("✔️ Response from server:"); 38 | Console.WriteLine(response); 39 | } 40 | 41 | static string GetArgument(string[] args, string key) 42 | { 43 | int index = Array.IndexOf(args, key); 44 | return index >= 0 && index < args.Length - 1 ? args[index + 1] : null; 45 | } 46 | 47 | static string SendRequest(string serverIp, int serverPort, object payload) 48 | { 49 | string payloadJson = JsonConvert.SerializeObject(payload); 50 | 51 | try 52 | { 53 | using (TcpClient client = new TcpClient(serverIp, serverPort)) 54 | { 55 | NetworkStream stream = client.GetStream(); 56 | 57 | // Send payload 58 | byte[] data = Encoding.UTF8.GetBytes(payloadJson); 59 | stream.Write(data, 0, data.Length); 60 | 61 | // Receive response 62 | byte[] buffer = new byte[4096]; 63 | int bytesRead; 64 | StringBuilder response = new StringBuilder(); 65 | 66 | do 67 | { 68 | bytesRead = stream.Read(buffer, 0, buffer.Length); 69 | response.Append(Encoding.UTF8.GetString(buffer, 0, bytesRead)); 70 | } while (bytesRead == buffer.Length); 71 | 72 | return response.ToString(); 73 | } 74 | } 75 | catch (Exception e) 76 | { 77 | return JsonConvert.SerializeObject(new { status = "error", message = e.Message }); 78 | } 79 | } 80 | } 81 | } 82 | ``` -------------------------------------------------------------------------------- /clients/C# .Net/Code Archiv/mcp_continue_chat.cs: -------------------------------------------------------------------------------- ```csharp 1 | using System; 2 | using System.Net.Sockets; 3 | using System.Text; 4 | using Newtonsoft.Json; 5 | 6 | namespace MCPChatContinuationClient 7 | { 8 | class Program 9 | { 10 | static void Main(string[] args) 11 | { 12 | if (args.Length < 6) 13 | { 14 | Console.WriteLine("Usage: --server-ip <IP> --server-port <PORT> --token <TOKEN> --conversation-id <ID> --message <MESSAGE>"); 15 | return; 16 | } 17 | 18 | string serverIp = GetArgument(args, "--server-ip"); 19 | int serverPort = int.Parse(GetArgument(args, "--server-port")); 20 | string token = GetArgument(args, "--token"); 21 | string conversationId = GetArgument(args, "--conversation-id"); 22 | string message = GetArgument(args, "--message"); 23 | 24 | var payload = new 25 | { 26 | command = "continue_chat", 27 | token = token, 28 | arguments = new 29 | { 30 | chatId = conversationId, 31 | question = message 32 | } 33 | }; 34 | 35 | Console.WriteLine("📤 Sending request to continue chat..."); 36 | string response = SendRequest(serverIp, serverPort, payload); 37 | Console.WriteLine("✔️ Response from server:"); 38 | Console.WriteLine(response); 39 | } 40 | 41 | static string GetArgument(string[] args, string key) 42 | { 43 | int index = Array.IndexOf(args, key); 44 | return index >= 0 && index < args.Length - 1 ? args[index + 1] : null; 45 | } 46 | 47 | static string SendRequest(string serverIp, int serverPort, object payload) 48 | { 49 | string payloadJson = JsonConvert.SerializeObject(payload); 50 | 51 | try 52 | { 53 | using (TcpClient client = new TcpClient(serverIp, serverPort)) 54 | { 55 | NetworkStream stream = client.GetStream(); 56 | 57 | // Send payload 58 | byte[] data = Encoding.UTF8.GetBytes(payloadJson); 59 | stream.Write(data, 0, data.Length); 60 | 61 | // Receive response 62 | byte[] buffer = new byte[4096]; 63 | int bytesRead; 64 | StringBuilder response = new StringBuilder(); 65 | 66 | do 67 | { 68 | bytesRead = stream.Read(buffer, 0, buffer.Length); 69 | response.Append(Encoding.UTF8.GetString(buffer, 0, bytesRead)); 70 | } while (bytesRead == buffer.Length); 71 | 72 | return response.ToString(); 73 | } 74 | } 75 | catch (Exception e) 76 | { 77 | return JsonConvert.SerializeObject(new { status = "error", message = e.Message }); 78 | } 79 | } 80 | } 81 | } 82 | ``` -------------------------------------------------------------------------------- /clients/Java/1.0 mcp_login/MCPLoginClient.java: -------------------------------------------------------------------------------- ```java 1 | import org.json.JSONObject; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.io.OutputStream; 6 | import java.net.Socket; 7 | import java.nio.charset.StandardCharsets; 8 | 9 | public class MCPLoginClient { 10 | 11 | public static void main(String[] args) { 12 | String serverIp = null; 13 | int serverPort = 0; 14 | String email = null; 15 | String password = null; 16 | 17 | // Argumente parsen 18 | for (int i = 0; i < args.length; i++) { 19 | switch (args[i]) { 20 | case "--server-ip": 21 | serverIp = args[++i]; 22 | break; 23 | case "--server-port": 24 | serverPort = Integer.parseInt(args[++i]); 25 | break; 26 | case "--email": 27 | email = args[++i]; 28 | break; 29 | case "--password": 30 | password = args[++i]; 31 | break; 32 | } 33 | } 34 | 35 | // Validierung 36 | if (serverIp == null || serverPort == 0 || email == null || password == null) { 37 | System.out.println("❌ ERROR: Missing required parameters."); 38 | return; 39 | } 40 | 41 | System.out.println("🔐 Logging in..."); 42 | 43 | // JSON-Objekt erstellen 44 | JSONObject payload = new JSONObject(); 45 | payload.put("command", "login"); 46 | 47 | JSONObject arguments = new JSONObject(); 48 | arguments.put("email", email); 49 | arguments.put("password", password); 50 | payload.put("arguments", arguments); 51 | 52 | // Request senden und Antwort empfangen 53 | String response = sendRequest(serverIp, serverPort, payload); 54 | System.out.println("✅ Server Response:"); 55 | System.out.println(response); 56 | } 57 | 58 | /** 59 | * Stellt eine TCP-Verbindung her, sendet das JSON und empfängt die Antwort. 60 | */ 61 | public static String sendRequest(String serverIp, int serverPort, JSONObject payload) { 62 | try (Socket socket = new Socket(serverIp, serverPort)) { 63 | // JSON in Byte-Array umwandeln 64 | String payloadString = payload.toString(); 65 | byte[] data = payloadString.getBytes(StandardCharsets.UTF_8); 66 | 67 | // Daten senden 68 | OutputStream out = socket.getOutputStream(); 69 | out.write(data); 70 | out.flush(); 71 | 72 | // Antwort empfangen 73 | InputStream in = socket.getInputStream(); 74 | byte[] buffer = new byte[4096]; 75 | int bytesRead = in.read(buffer); 76 | 77 | if (bytesRead == -1) { 78 | // Falls keine Daten empfangen wurden 79 | return "❌ ERROR: No response from server."; 80 | } 81 | 82 | return new String(buffer, 0, bytesRead, StandardCharsets.UTF_8); 83 | 84 | } catch (IOException e) { 85 | e.printStackTrace(); 86 | return "❌ ERROR: " + e.getMessage(); 87 | } 88 | } 89 | } 90 | ``` -------------------------------------------------------------------------------- /clients/Go/2.0 mcp_chat/MCPChatClient.go: -------------------------------------------------------------------------------- ```go 1 | package main 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "errors" 7 | "flag" 8 | "fmt" 9 | "io" 10 | "net" 11 | "os" 12 | ) 13 | 14 | type MCPRequest struct { 15 | Command string `json:"command"` 16 | Token string `json:"token"` 17 | Arguments map[string]interface{} `json:"arguments"` 18 | } 19 | 20 | func sendMCPRequest(serverIP string, serverPort int, token, question string, usePublic bool, groups []string, language string) (map[string]interface{}, error) { 21 | // Prepare the request payload 22 | payload := MCPRequest{ 23 | Command: "chat", 24 | Token: token, 25 | Arguments: map[string]interface{}{ 26 | "question": question, 27 | "usePublic": usePublic, 28 | "groups": groups, 29 | "language": language, 30 | }, 31 | } 32 | 33 | // Convert the payload to JSON 34 | payloadJSON, err := json.Marshal(payload) 35 | if err != nil { 36 | return nil, err 37 | } 38 | 39 | // Create a connection to the server 40 | conn, err := net.Dial("tcp", fmt.Sprintf("%s:%d", serverIP, serverPort)) 41 | if err != nil { 42 | return nil, err 43 | } 44 | defer conn.Close() 45 | 46 | // Send the request 47 | _, err = conn.Write(payloadJSON) 48 | if err != nil { 49 | return nil, err 50 | } 51 | 52 | // Receive the response 53 | var responseBuffer bytes.Buffer 54 | buf := make([]byte, 4096) 55 | for { 56 | n, err := conn.Read(buf) 57 | if err != nil { 58 | if errors.Is(err, io.EOF) { 59 | break 60 | } 61 | return nil, err 62 | } 63 | responseBuffer.Write(buf[:n]) 64 | if n < 4096 { 65 | break 66 | } 67 | } 68 | 69 | // Decode the response 70 | var response map[string]interface{} 71 | err = json.Unmarshal(responseBuffer.Bytes(), &response) 72 | if err != nil { 73 | return nil, err 74 | } 75 | 76 | return response, nil 77 | } 78 | 79 | func main() { 80 | serverIP := flag.String("server-ip", "", "IP address of the MCP server") 81 | serverPort := flag.Int("server-port", 0, "Port number of the MCP server") 82 | token := flag.String("token", "", "Authentication token") 83 | question := flag.String("question", "", "The question to ask the MCP server") 84 | usePublic := flag.Bool("use-public", false, "Use the public knowledge base") 85 | groups := flag.String("groups", "", "Comma-separated list of groups for retrieval-augmented generation") 86 | language := flag.String("language", "de", "Language code for the request (default: 'de')") 87 | 88 | flag.Parse() 89 | 90 | if *serverIP == "" || *serverPort == 0 || *token == "" || *question == "" { 91 | fmt.Println("❌ ERROR: Required flags are missing.") 92 | flag.Usage() 93 | os.Exit(1) 94 | } 95 | 96 | // Convert groups to a slice 97 | groupList := []string{} 98 | if *groups != "" { 99 | groupList = append(groupList, *groups) 100 | } 101 | 102 | // Send the question to the MCP server 103 | fmt.Println("💬 Sending request to the MCP server...") 104 | response, err := sendMCPRequest(*serverIP, *serverPort, *token, *question, *usePublic, groupList, *language) 105 | if err != nil { 106 | fmt.Printf("❌ ERROR: %v\n", err) 107 | os.Exit(1) 108 | } 109 | 110 | responseJSON, err := json.MarshalIndent(response, "", " ") 111 | if err != nil { 112 | fmt.Printf("❌ ERROR: %v\n", err) 113 | os.Exit(1) 114 | } 115 | 116 | fmt.Println("✅ Response from server:") 117 | fmt.Println(string(responseJSON)) 118 | } 119 | ``` -------------------------------------------------------------------------------- /clients/Python/5.2 mcp_delete_user/MCPDeleteUserClient.py: -------------------------------------------------------------------------------- ```python 1 | import socket 2 | import ssl 3 | import json 4 | import argparse 5 | import sys 6 | 7 | def send_delete_user_request(server_ip, server_port, email, token, use_ssl=True, accept_self_signed=False): 8 | """ 9 | Sends a request to delete a user from the MCP server. 10 | """ 11 | payload = { 12 | "command": "delete_user", 13 | "token": token, 14 | "arguments": { 15 | "email": email 16 | } 17 | } 18 | 19 | payload_json = json.dumps(payload) 20 | 21 | raw_socket = None 22 | client_socket = None 23 | 24 | try: 25 | raw_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 26 | raw_socket.settimeout(10) 27 | 28 | if use_ssl: 29 | context = ssl.create_default_context() 30 | if accept_self_signed: 31 | context.check_hostname = False 32 | context.verify_mode = ssl.CERT_NONE 33 | client_socket = context.wrap_socket(raw_socket, server_hostname=server_ip) 34 | else: 35 | client_socket = raw_socket 36 | 37 | client_socket.connect((server_ip, server_port)) 38 | client_socket.sendall(payload_json.encode('utf-8')) 39 | 40 | response = b"" 41 | while True: 42 | part = client_socket.recv(4096) 43 | if not part: 44 | break 45 | response += part 46 | 47 | return response.decode('utf-8') 48 | except ssl.SSLError: 49 | return "Error: Server and/or client may require TLS encryption. Please enable SSL/TLS." 50 | except Exception as e: 51 | return f"Error: {e}" 52 | 53 | finally: 54 | if client_socket is not None: 55 | try: 56 | client_socket.shutdown(socket.SHUT_RDWR) 57 | except: 58 | pass 59 | client_socket.close() 60 | 61 | if __name__ == "__main__": 62 | parser = argparse.ArgumentParser( 63 | description="Send a request to delete a user from the MCP server.", 64 | formatter_class=argparse.RawTextHelpFormatter 65 | ) 66 | parser.add_argument("--server-ip", required=True, help="IP address of the MCP server") 67 | parser.add_argument("--server-port", required=True, type=int, help="Port number of the MCP server") 68 | parser.add_argument("--email", required=True, help="Email of the user to delete") 69 | parser.add_argument("--token", required=True, help="Authentication token") 70 | parser.add_argument("--use-ssl", action="store_true", help="Connect using SSL/TLS") 71 | parser.add_argument("--accept-self-signed", action="store_true", help="Accept self-signed certificates (disable certificate verification)") 72 | 73 | # If no arguments are provided, print help and exit 74 | if len(sys.argv) == 1: 75 | parser.print_help(sys.stderr) 76 | sys.exit(1) 77 | 78 | args = parser.parse_args() 79 | 80 | response = send_delete_user_request( 81 | args.server_ip, 82 | args.server_port, 83 | args.email, 84 | args.token, 85 | use_ssl=args.use_ssl, 86 | accept_self_signed=args.accept_self_signed 87 | ) 88 | print("Response from server:", response) 89 | ``` -------------------------------------------------------------------------------- /clients/Python/3.4 mcp_delete_source/MCPDeleteSourceClient.py: -------------------------------------------------------------------------------- ```python 1 | import socket 2 | import ssl 3 | import json 4 | import argparse 5 | 6 | def delete_source(server_ip, server_port, token, source_id, use_ssl=True, accept_self_signed=False): 7 | """ 8 | Sends a request to the MCP server to delete an existing source. 9 | 10 | :param server_ip: IP address of the MCP server 11 | :param server_port: Port number of the MCP server 12 | :param token: Authorization token 13 | :param source_id: ID of the source to delete 14 | :param use_ssl: Whether to use SSL/TLS for the connection 15 | :param accept_self_signed: Whether to accept self-signed certificates 16 | :return: Response from the server 17 | """ 18 | payload = { 19 | "command": "delete_source", 20 | "token": token, 21 | "arguments": { 22 | "sourceId": source_id 23 | } 24 | } 25 | 26 | payload_json = json.dumps(payload) 27 | 28 | raw_socket = None 29 | client_socket = None 30 | 31 | try: 32 | raw_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 33 | raw_socket.settimeout(10) 34 | 35 | if use_ssl: 36 | context = ssl.create_default_context() 37 | if accept_self_signed: 38 | context.check_hostname = False 39 | context.verify_mode = ssl.CERT_NONE 40 | client_socket = context.wrap_socket(raw_socket, server_hostname=server_ip) 41 | else: 42 | client_socket = raw_socket 43 | 44 | client_socket.connect((server_ip, server_port)) 45 | client_socket.sendall(payload_json.encode('utf-8')) 46 | 47 | response = b"" 48 | while True: 49 | part = client_socket.recv(4096) 50 | if not part: 51 | break 52 | response += part 53 | 54 | return response.decode('utf-8') 55 | except ssl.SSLError: 56 | return "Error: Server and/or client may require TLS encryption. Please enable SSL/TLS." 57 | except Exception as e: 58 | return f"Error: {e}" 59 | 60 | finally: 61 | if client_socket is not None: 62 | try: 63 | client_socket.shutdown(socket.SHUT_RDWR) 64 | except: 65 | pass 66 | client_socket.close() 67 | 68 | if __name__ == "__main__": 69 | parser = argparse.ArgumentParser(description="Delete a source from the MCP server.") 70 | parser.add_argument("--server-ip", required=True, help="IP address of the MCP server") 71 | parser.add_argument("--server-port", type=int, required=True, help="Port number of the MCP server") 72 | parser.add_argument("--token", required=True, help="Authorization token") 73 | parser.add_argument("--source-id", required=True, help="ID of the source to delete") 74 | parser.add_argument("--use-ssl", action="store_true", help="Connect using SSL/TLS") 75 | parser.add_argument("--accept-self-signed", action="store_true", help="Accept self-signed certificates (disable certificate verification)") 76 | 77 | args = parser.parse_args() 78 | 79 | response = delete_source( 80 | args.server_ip, 81 | args.server_port, 82 | args.token, 83 | args.source_id, 84 | use_ssl=args.use_ssl, 85 | accept_self_signed=args.accept_self_signed 86 | ) 87 | print("Response from server:", response) 88 | ``` -------------------------------------------------------------------------------- /agents/MCP-Client/Python/transport/stdio/stdio_server_shutdown.py: -------------------------------------------------------------------------------- ```python 1 | # transport/stdio/stdio_server_shutdown.py 2 | import logging 3 | from typing import Optional 4 | 5 | import anyio 6 | from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream 7 | 8 | 9 | async def shutdown_stdio_server( 10 | read_stream: Optional[MemoryObjectReceiveStream], 11 | write_stream: Optional[MemoryObjectSendStream], 12 | process: anyio.abc.Process, 13 | timeout: float = 5.0, 14 | ) -> None: 15 | """ 16 | Gracefully shutdown a stdio-based server. 17 | 18 | This function performs the following steps: 19 | 1. Closes the stdin stream of the process. 20 | 2. Waits for the process to terminate gracefully. 21 | 3. Sends SIGTERM if the process does not terminate within the timeout. 22 | 4. Sends SIGKILL if the process does not terminate after SIGTERM. 23 | 5. Logs each step and ensures cleanup in case of errors. 24 | 25 | Args: 26 | read_stream (Optional[MemoryObjectReceiveStream]): Stream to receive responses. 27 | write_stream (Optional[MemoryObjectSendStream]): Stream to send requests. 28 | process (anyio.abc.Process): The server process. 29 | timeout (float): Time to wait for graceful shutdown and SIGTERM before escalation. 30 | """ 31 | logging.info("Initiating stdio server shutdown") 32 | 33 | try: 34 | # ensure we have a process 35 | if process: 36 | # Step 1: Close the write stream (stdin for the server) 37 | if process.stdin: 38 | # close 39 | await process.stdin.aclose() 40 | logging.info("Closed stdin stream") 41 | 42 | # Step 2: Wait for the process to terminate gracefully 43 | with anyio.fail_after(timeout): 44 | await process.wait() 45 | logging.info("Process exited normally") 46 | return 47 | 48 | except TimeoutError: 49 | logging.warning( 50 | f"Server did not exit within {timeout} seconds, sending SIGTERM" 51 | ) 52 | 53 | # ensure we have a process 54 | if process: 55 | # terminate 56 | process.terminate() 57 | 58 | try: 59 | # Step 3: Wait for the process to terminate after SIGTERM 60 | with anyio.fail_after(timeout): 61 | await process.wait() 62 | logging.info("Process exited after SIGTERM") 63 | return 64 | except TimeoutError: 65 | logging.warning("Server did not respond to SIGTERM, sending SIGKILL") 66 | 67 | # ensure we have a process 68 | if process: 69 | # kill 70 | process.kill() 71 | 72 | # Step 4: Wait for the process to terminate after SIGKILL 73 | await process.wait() 74 | logging.info("Process exited after SIGKILL") 75 | 76 | except Exception as e: 77 | # Catch unexpected errors during shutdown 78 | logging.error(f"Unexpected error during stdio server shutdown: {e}") 79 | 80 | if process: 81 | # kill 82 | process.kill() 83 | 84 | # wait 85 | await process.wait() 86 | logging.info("Process forcibly terminated") 87 | finally: 88 | # complete 89 | logging.info("Stdio server shutdown complete") 90 | ``` -------------------------------------------------------------------------------- /clients/Gradio/transport/stdio/stdio_server_shutdown.py: -------------------------------------------------------------------------------- ```python 1 | # transport/stdio/stdio_server_shutdown.py 2 | import logging 3 | from typing import Optional 4 | 5 | import anyio 6 | from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream 7 | 8 | 9 | async def shutdown_stdio_server( 10 | read_stream: Optional[MemoryObjectReceiveStream], 11 | write_stream: Optional[MemoryObjectSendStream], 12 | process: anyio.abc.Process, 13 | timeout: float = 5.0, 14 | ) -> None: 15 | """ 16 | Gracefully shutdown a stdio-based server. 17 | 18 | This function performs the following steps: 19 | 1. Closes the stdin stream of the process. 20 | 2. Waits for the process to terminate gracefully. 21 | 3. Sends SIGTERM if the process does not terminate within the timeout. 22 | 4. Sends SIGKILL if the process does not terminate after SIGTERM. 23 | 5. Logs each step and ensures cleanup in case of errors. 24 | 25 | Args: 26 | read_stream (Optional[MemoryObjectReceiveStream]): Stream to receive responses. 27 | write_stream (Optional[MemoryObjectSendStream]): Stream to send requests. 28 | process (anyio.abc.Process): The server process. 29 | timeout (float): Time to wait for graceful shutdown and SIGTERM before escalation. 30 | """ 31 | logging.info("Initiating stdio server shutdown") 32 | 33 | try: 34 | # ensure we have a process 35 | if process: 36 | # Step 1: Close the write stream (stdin for the server) 37 | if process.stdin: 38 | # close 39 | await process.stdin.aclose() 40 | logging.info("Closed stdin stream") 41 | 42 | # Step 2: Wait for the process to terminate gracefully 43 | with anyio.fail_after(timeout): 44 | await process.wait() 45 | logging.info("Process exited normally") 46 | return 47 | 48 | except TimeoutError: 49 | logging.warning( 50 | f"Server did not exit within {timeout} seconds, sending SIGTERM" 51 | ) 52 | 53 | # ensure we have a process 54 | if process: 55 | # terminate 56 | process.terminate() 57 | 58 | try: 59 | # Step 3: Wait for the process to terminate after SIGTERM 60 | with anyio.fail_after(timeout): 61 | await process.wait() 62 | logging.info("Process exited after SIGTERM") 63 | return 64 | except TimeoutError: 65 | logging.warning("Server did not respond to SIGTERM, sending SIGKILL") 66 | 67 | # ensure we have a process 68 | if process: 69 | # kill 70 | process.kill() 71 | 72 | # Step 4: Wait for the process to terminate after SIGKILL 73 | await process.wait() 74 | logging.info("Process exited after SIGKILL") 75 | 76 | except Exception as e: 77 | # Catch unexpected errors during shutdown 78 | logging.error(f"Unexpected error during stdio server shutdown: {e}") 79 | 80 | if process: 81 | # kill 82 | process.kill() 83 | 84 | # wait 85 | await process.wait() 86 | logging.info("Process forcibly terminated") 87 | finally: 88 | # complete 89 | logging.info("Stdio server shutdown complete") 90 | ``` -------------------------------------------------------------------------------- /clients/Python/2.4 mcp_delete_chat/MCPDeleteChatClient.py: -------------------------------------------------------------------------------- ```python 1 | import socket 2 | import ssl 3 | import json 4 | import argparse 5 | 6 | def send_delete_chat_request(server_ip, server_port, token, chat_id, use_ssl=True, accept_self_signed=False): 7 | """ 8 | Sends a request to delete a specific chat from the MCP server. 9 | 10 | :param server_ip: IP address of the MCP server 11 | :param server_port: Port number of the MCP server 12 | :param token: Authentication token 13 | :param chat_id: ID of the chat to be deleted 14 | :param use_ssl: Whether to use SSL/TLS for the connection 15 | :param accept_self_signed: Whether to accept self-signed certificates 16 | :return: Response from the server 17 | """ 18 | payload = { 19 | "command": "delete_chat", 20 | "token": token, 21 | "arguments": { 22 | "chatId": chat_id 23 | } 24 | } 25 | 26 | payload_json = json.dumps(payload) 27 | 28 | raw_socket = None 29 | client_socket = None 30 | 31 | try: 32 | raw_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 33 | raw_socket.settimeout(10) 34 | 35 | if use_ssl: 36 | context = ssl.create_default_context() 37 | if accept_self_signed: 38 | context.check_hostname = False 39 | context.verify_mode = ssl.CERT_NONE 40 | client_socket = context.wrap_socket(raw_socket, server_hostname=server_ip) 41 | else: 42 | client_socket = raw_socket 43 | 44 | client_socket.connect((server_ip, server_port)) 45 | client_socket.sendall(payload_json.encode('utf-8')) 46 | 47 | response = b"" 48 | while True: 49 | part = client_socket.recv(4096) 50 | if not part: 51 | break 52 | response += part 53 | 54 | return response.decode('utf-8') 55 | except ssl.SSLError: 56 | return "Error: The server requires TLS encryption. Please enable SSL/TLS." 57 | except Exception as e: 58 | return f"Error: {e}" 59 | 60 | finally: 61 | if client_socket is not None: 62 | try: 63 | client_socket.shutdown(socket.SHUT_RDWR) 64 | except: 65 | pass 66 | client_socket.close() 67 | 68 | if __name__ == "__main__": 69 | parser = argparse.ArgumentParser(description="Delete a specific chat on the MCP server.") 70 | parser.add_argument("--server-ip", required=True, help="IP address of the MCP server") 71 | parser.add_argument("--server-port", required=True, type=int, help="Port number of the MCP server") 72 | parser.add_argument("--token", required=True, help="Authentication token") 73 | parser.add_argument("--chat-id", required=True, help="ID of the chat to be deleted") 74 | parser.add_argument("--use-ssl", action="store_true", help="Connect using SSL/TLS") 75 | parser.add_argument("--accept-self-signed", action="store_true", help="Accept self-signed certificates (disable certificate verification)") 76 | 77 | args = parser.parse_args() 78 | 79 | response = send_delete_chat_request( 80 | args.server_ip, 81 | args.server_port, 82 | args.token, 83 | args.chat_id, 84 | use_ssl=args.use_ssl, 85 | accept_self_signed=args.accept_self_signed 86 | ) 87 | print("Response from server:", response) 88 | ``` -------------------------------------------------------------------------------- /clients/Python/3.1 mcp_get_source/MCPGetSourceClient.py: -------------------------------------------------------------------------------- ```python 1 | import socket 2 | import ssl 3 | import json 4 | import argparse 5 | 6 | def get_source_information(server_ip, server_port, token, source_id, use_ssl=True, accept_self_signed=False): 7 | """ 8 | Sends a request to the MCP server to get information about an existing source. 9 | 10 | :param server_ip: IP address of the MCP server 11 | :param server_port: Port number of the MCP server 12 | :param token: Authentication token 13 | :param source_id: ID of the source to retrieve 14 | :param use_ssl: Whether to use SSL/TLS for the connection 15 | :param accept_self_signed: Whether to accept self-signed certificates 16 | :return: Response from the server 17 | """ 18 | payload = { 19 | "command": "get_source", 20 | "token": token, 21 | "arguments": { 22 | "sourceId": source_id 23 | } 24 | } 25 | 26 | payload_json = json.dumps(payload) 27 | 28 | raw_socket = None 29 | client_socket = None 30 | 31 | try: 32 | raw_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 33 | raw_socket.settimeout(10) 34 | 35 | if use_ssl: 36 | context = ssl.create_default_context() 37 | if accept_self_signed: 38 | context.check_hostname = False 39 | context.verify_mode = ssl.CERT_NONE 40 | client_socket = context.wrap_socket(raw_socket, server_hostname=server_ip) 41 | else: 42 | client_socket = raw_socket 43 | 44 | client_socket.connect((server_ip, server_port)) 45 | client_socket.sendall(payload_json.encode('utf-8')) 46 | 47 | response = b"" 48 | while True: 49 | part = client_socket.recv(4096) 50 | if not part: 51 | break 52 | response += part 53 | 54 | return response.decode('utf-8') 55 | except ssl.SSLError: 56 | return "Error: Server and/or client may require TLS encryption. Please enable SSL/TLS." 57 | except Exception as e: 58 | return f"Error: {e}" 59 | 60 | finally: 61 | if client_socket is not None: 62 | try: 63 | client_socket.shutdown(socket.SHUT_RDWR) 64 | except: 65 | pass 66 | client_socket.close() 67 | 68 | if __name__ == "__main__": 69 | # Argument parser for command-line arguments 70 | parser = argparse.ArgumentParser(description="Retrieve information about an existing source from the MCP server.") 71 | parser.add_argument("--server-ip", required=True, help="IP address of the MCP server") 72 | parser.add_argument("--server-port", required=True, type=int, help="Port number of the MCP server") 73 | parser.add_argument("--token", required=True, help="Authentication token") 74 | parser.add_argument("--source-id", required=True, help="ID of the source to retrieve") 75 | parser.add_argument("--use-ssl", action="store_true", help="Connect using SSL/TLS") 76 | parser.add_argument("--accept-self-signed", action="store_true", help="Accept self-signed certificates (disable certificate verification)") 77 | 78 | args = parser.parse_args() 79 | 80 | # Retrieve the source information and print the response 81 | response = get_source_information( 82 | args.server_ip, 83 | args.server_port, 84 | args.token, 85 | args.source_id, 86 | use_ssl=args.use_ssl, 87 | accept_self_signed=args.accept_self_signed 88 | ) 89 | print("Response from server:", response) 90 | ``` -------------------------------------------------------------------------------- /clients/Python/3.2 mcp_list_sources/MCPListSourcesClient.py: -------------------------------------------------------------------------------- ```python 1 | import socket 2 | import ssl 3 | import json 4 | import argparse 5 | 6 | def send_list_sources_request(server_ip, server_port, token, group_name, use_ssl=True, accept_self_signed=False): 7 | """ 8 | Sends a request to list sources in a specific group to the MCP server. 9 | 10 | :param server_ip: IP address of the MCP server 11 | :param server_port: Port number of the MCP server 12 | :param token: Authentication token 13 | :param group_name: Name of the group to list sources from 14 | :param use_ssl: Whether to use SSL/TLS for the connection 15 | :param accept_self_signed: Whether to accept self-signed certificates 16 | :return: Response from the server 17 | """ 18 | payload = { 19 | "command": "list_sources", 20 | "token": token, 21 | "attributes": { 22 | "groupName": group_name 23 | } 24 | } 25 | 26 | payload_json = json.dumps(payload) 27 | 28 | raw_socket = None 29 | client_socket = None 30 | 31 | try: 32 | raw_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 33 | raw_socket.settimeout(10) 34 | 35 | if use_ssl: 36 | context = ssl.create_default_context() 37 | if accept_self_signed: 38 | context.check_hostname = False 39 | context.verify_mode = ssl.CERT_NONE 40 | client_socket = context.wrap_socket(raw_socket, server_hostname=server_ip) 41 | else: 42 | client_socket = raw_socket 43 | 44 | client_socket.connect((server_ip, server_port)) 45 | client_socket.sendall(payload_json.encode('utf-8')) 46 | 47 | response = b"" 48 | while True: 49 | part = client_socket.recv(4096) 50 | if not part: 51 | break 52 | response += part 53 | 54 | return response.decode('utf-8') 55 | except ssl.SSLError: 56 | return "Error: Server and/or client may require TLS encryption. Please enable SSL/TLS." 57 | except Exception as e: 58 | return f"Error: {e}" 59 | 60 | finally: 61 | if client_socket is not None: 62 | try: 63 | client_socket.shutdown(socket.SHUT_RDWR) 64 | except: 65 | pass 66 | client_socket.close() 67 | 68 | if __name__ == "__main__": 69 | # Argument parser for command-line arguments 70 | parser = argparse.ArgumentParser(description="List sources in a specific group from the MCP server.") 71 | parser.add_argument("--server-ip", required=True, help="IP address of the MCP server") 72 | parser.add_argument("--server-port", required=True, type=int, help="Port number of the MCP server") 73 | parser.add_argument("--token", required=True, help="Authentication token") 74 | parser.add_argument("--group-name", required=True, help="Name of the group to list sources from") 75 | parser.add_argument("--use-ssl", action="store_true", help="Connect using SSL/TLS") 76 | parser.add_argument("--accept-self-signed", action="store_true", help="Accept self-signed certificates (disable certificate verification)") 77 | 78 | args = parser.parse_args() 79 | 80 | # Send the request to list sources and print the response 81 | response = send_list_sources_request( 82 | args.server_ip, 83 | args.server_port, 84 | args.token, 85 | args.group_name, 86 | use_ssl=args.use_ssl, 87 | accept_self_signed=args.accept_self_signed 88 | ) 89 | print("Response from server:", response) 90 | ``` -------------------------------------------------------------------------------- /clients/JavaScript/1.1 mcp_logout/MCPLogoutClient.js: -------------------------------------------------------------------------------- ```javascript 1 | const net = require('net'); 2 | const readline = require('readline'); 3 | const { argv, exit } = require('process'); 4 | 5 | // Funktion zum Parsen der Kommandozeilenargumente 6 | function parseArguments(args) { 7 | const parsedArgs = {}; 8 | for (let i = 2; i < args.length; i++) { 9 | switch (args[i]) { 10 | case '--server-ip': 11 | parsedArgs.serverIp = args[++i]; 12 | break; 13 | case '--server-port': 14 | parsedArgs.serverPort = parseInt(args[++i], 10); 15 | break; 16 | case '--token': 17 | parsedArgs.token = args[++i]; 18 | break; 19 | default: 20 | console.warn(`Unbekanntes Argument: ${args[i]}`); 21 | } 22 | } 23 | return parsedArgs; 24 | } 25 | 26 | // Funktion zum interaktiven Abfragen des Tokens (optional) 27 | function askToken(query) { 28 | const rl = readline.createInterface({ 29 | input: process.stdin, 30 | output: process.stdout, 31 | terminal: true 32 | }); 33 | 34 | return new Promise((resolve) => { 35 | rl.question(query, (token) => { 36 | rl.close(); 37 | resolve(token); 38 | }); 39 | }); 40 | } 41 | 42 | // Funktion zum Senden einer Logout-Anfrage über eine TCP-Verbindung 43 | function sendLogoutRequest(serverIp, serverPort, payload) { 44 | return new Promise((resolve, reject) => { 45 | const client = new net.Socket(); 46 | let responseData = ''; 47 | 48 | client.connect(serverPort, serverIp, () => { 49 | console.log('🔗 Verbindung zum Server hergestellt.'); 50 | client.write(JSON.stringify(payload)); 51 | }); 52 | 53 | client.on('data', (data) => { 54 | responseData += data.toString(); 55 | try { 56 | const parsedData = JSON.parse(responseData); 57 | resolve(parsedData); 58 | client.destroy(); // Verbindung schließen 59 | } catch (err) { 60 | // Antwort noch nicht vollständig, weiter empfangen 61 | } 62 | }); 63 | 64 | client.on('close', () => { 65 | console.log('🔒 Verbindung zum Server geschlossen.'); 66 | }); 67 | 68 | client.on('error', (err) => { 69 | reject(err); 70 | }); 71 | }); 72 | } 73 | 74 | // Hauptfunktion 75 | async function main() { 76 | const args = argv; 77 | const parsedArgs = parseArguments(args); 78 | const { serverIp, serverPort, token } = parsedArgs; 79 | 80 | // Überprüfen, ob alle erforderlichen Parameter außer Token vorhanden sind 81 | if (!serverIp || !serverPort) { 82 | console.error('❌ ERROR: Fehlende erforderliche Parameter.'); 83 | console.log('Verwendung: node MCPLogoutClient.js --server-ip <IP> --server-port <Port> --token <Token>'); 84 | exit(1); 85 | } 86 | 87 | // Token interaktiv abfragen, falls nicht in den Argumenten vorhanden 88 | let authToken = token; 89 | if (!authToken) { 90 | authToken = await askToken('🔒 Bitte gib dein Authentifizierungstoken ein: '); 91 | } 92 | 93 | const payload = { 94 | command: "logout", 95 | token: authToken 96 | }; 97 | 98 | try { 99 | console.log('🚪 Logging out...'); 100 | const response = await sendLogoutRequest(serverIp, serverPort, payload); 101 | console.log('✅ Server Response:'); 102 | console.log(JSON.stringify(response, null, 4)); 103 | } catch (err) { 104 | console.error('❌ ERROR:', err.message); 105 | } 106 | } 107 | 108 | main(); 109 | ``` -------------------------------------------------------------------------------- /clients/C# .Net/2.0 mcp_chat/Program.cs: -------------------------------------------------------------------------------- ```csharp 1 | using System; 2 | using System.Net.Sockets; 3 | using System.Text; 4 | using Newtonsoft.Json; 5 | using System.Collections.Generic; 6 | 7 | namespace MCPClient 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | if (args.Length < 5) 14 | { 15 | Console.WriteLine("Usage: --server-ip <IP> --server-port <PORT> --token <TOKEN> --question <QUESTION> [--use-public] [--groups <GROUPS>] [--language <LANGUAGE>]"); 16 | return; 17 | } 18 | 19 | string serverIp = GetArgument(args, "--server-ip"); 20 | int serverPort = int.Parse(GetArgument(args, "--server-port")); 21 | string token = GetArgument(args, "--token"); 22 | string question = GetArgument(args, "--question"); 23 | bool usePublic = Array.Exists(args, arg => arg == "--use-public"); 24 | string language = GetArgument(args, "--language") ?? "de"; 25 | 26 | List<string> groups = new List<string>(); 27 | string groupsArgument = GetArgument(args, "--groups"); 28 | if (groupsArgument != null) 29 | { 30 | groups.AddRange(groupsArgument.Split(",")); 31 | } 32 | 33 | var response = SendMCPRequest(serverIp, serverPort, token, question, usePublic, groups, language); 34 | Console.WriteLine("Response from server:"); 35 | Console.WriteLine(response); 36 | } 37 | 38 | static string GetArgument(string[] args, string key) 39 | { 40 | int index = Array.IndexOf(args, key); 41 | return index >= 0 && index < args.Length - 1 ? args[index + 1] : null; 42 | } 43 | 44 | static string SendMCPRequest(string serverIp, int serverPort, string token, string question, bool usePublic, List<string> groups, string language) 45 | { 46 | var payload = new 47 | { 48 | command = "chat", 49 | token = token, 50 | arguments = new 51 | { 52 | question = question, 53 | usePublic = usePublic, 54 | groups = groups, 55 | language = language 56 | } 57 | }; 58 | 59 | string payloadJson = JsonConvert.SerializeObject(payload); 60 | try 61 | { 62 | using (TcpClient client = new TcpClient(serverIp, serverPort)) 63 | { 64 | NetworkStream stream = client.GetStream(); 65 | 66 | // Send payload 67 | byte[] data = Encoding.UTF8.GetBytes(payloadJson); 68 | stream.Write(data, 0, data.Length); 69 | 70 | // Receive response 71 | byte[] buffer = new byte[4096]; 72 | int bytesRead; 73 | StringBuilder response = new StringBuilder(); 74 | 75 | do 76 | { 77 | bytesRead = stream.Read(buffer, 0, buffer.Length); 78 | response.Append(Encoding.UTF8.GetString(buffer, 0, bytesRead)); 79 | } while (bytesRead == buffer.Length); 80 | 81 | return response.ToString(); 82 | } 83 | } 84 | catch (Exception e) 85 | { 86 | return JsonConvert.SerializeObject(new { status = "error", message = e.Message }); 87 | } 88 | } 89 | } 90 | } 91 | ``` -------------------------------------------------------------------------------- /clients/C# .Net/Code Archiv/mcp_chat.cs: -------------------------------------------------------------------------------- ```csharp 1 | using System; 2 | using System.Net.Sockets; 3 | using System.Text; 4 | using Newtonsoft.Json; 5 | using System.Collections.Generic; 6 | 7 | namespace MCPClient 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | if (args.Length < 5) 14 | { 15 | Console.WriteLine("Usage: --server-ip <IP> --server-port <PORT> --token <TOKEN> --question <QUESTION> [--use-public] [--groups <GROUPS>] [--language <LANGUAGE>]"); 16 | return; 17 | } 18 | 19 | string serverIp = GetArgument(args, "--server-ip"); 20 | int serverPort = int.Parse(GetArgument(args, "--server-port")); 21 | string token = GetArgument(args, "--token"); 22 | string question = GetArgument(args, "--question"); 23 | bool usePublic = Array.Exists(args, arg => arg == "--use-public"); 24 | string language = GetArgument(args, "--language") ?? "de"; 25 | 26 | List<string> groups = new List<string>(); 27 | string groupsArgument = GetArgument(args, "--groups"); 28 | if (groupsArgument != null) 29 | { 30 | groups.AddRange(groupsArgument.Split(",")); 31 | } 32 | 33 | var response = SendMCPRequest(serverIp, serverPort, token, question, usePublic, groups, language); 34 | Console.WriteLine("Response from server:"); 35 | Console.WriteLine(response); 36 | } 37 | 38 | static string GetArgument(string[] args, string key) 39 | { 40 | int index = Array.IndexOf(args, key); 41 | return index >= 0 && index < args.Length - 1 ? args[index + 1] : null; 42 | } 43 | 44 | static string SendMCPRequest(string serverIp, int serverPort, string token, string question, bool usePublic, List<string> groups, string language) 45 | { 46 | var payload = new 47 | { 48 | command = "chat", 49 | token = token, 50 | arguments = new 51 | { 52 | question = question, 53 | usePublic = usePublic, 54 | groups = groups, 55 | language = language 56 | } 57 | }; 58 | 59 | string payloadJson = JsonConvert.SerializeObject(payload); 60 | try 61 | { 62 | using (TcpClient client = new TcpClient(serverIp, serverPort)) 63 | { 64 | NetworkStream stream = client.GetStream(); 65 | 66 | // Send payload 67 | byte[] data = Encoding.UTF8.GetBytes(payloadJson); 68 | stream.Write(data, 0, data.Length); 69 | 70 | // Receive response 71 | byte[] buffer = new byte[4096]; 72 | int bytesRead; 73 | StringBuilder response = new StringBuilder(); 74 | 75 | do 76 | { 77 | bytesRead = stream.Read(buffer, 0, buffer.Length); 78 | response.Append(Encoding.UTF8.GetString(buffer, 0, bytesRead)); 79 | } while (bytesRead == buffer.Length); 80 | 81 | return response.ToString(); 82 | } 83 | } 84 | catch (Exception e) 85 | { 86 | return JsonConvert.SerializeObject(new { status = "error", message = e.Message }); 87 | } 88 | } 89 | } 90 | } 91 | ``` -------------------------------------------------------------------------------- /clients/JavaScript/1.0 mcp_login/MCPLoginClient.js: -------------------------------------------------------------------------------- ```javascript 1 | const net = require('net'); 2 | const readline = require('readline'); 3 | const { argv, exit } = require('process'); 4 | 5 | // Funktion zum Parsen der Kommandozeilenargumente 6 | function parseArguments(args) { 7 | const parsedArgs = {}; 8 | for (let i = 2; i < args.length; i++) { 9 | switch (args[i]) { 10 | case '--server-ip': 11 | parsedArgs.serverIp = args[++i]; 12 | break; 13 | case '--server-port': 14 | parsedArgs.serverPort = parseInt(args[++i], 10); 15 | break; 16 | case '--email': 17 | parsedArgs.email = args[++i]; 18 | break; 19 | case '--password': 20 | parsedArgs.password = args[++i]; 21 | break; 22 | default: 23 | console.warn(`Unbekanntes Argument: ${args[i]}`); 24 | } 25 | } 26 | return parsedArgs; 27 | } 28 | 29 | // Funktion zum Senden einer Anfrage über eine TCP-Verbindung 30 | function sendRequest(serverIp, serverPort, payload) { 31 | return new Promise((resolve, reject) => { 32 | const client = new net.Socket(); 33 | let responseData = ''; 34 | 35 | client.connect(serverPort, serverIp, () => { 36 | console.log('🔗 Verbindung zum Server hergestellt.'); 37 | client.write(JSON.stringify(payload)); 38 | }); 39 | 40 | client.on('data', (data) => { 41 | responseData += data.toString(); 42 | // Versuche, die empfangenen Daten als JSON zu parsen 43 | try { 44 | const parsedData = JSON.parse(responseData); 45 | resolve(parsedData); 46 | client.destroy(); // Verbindung schließen 47 | } catch (err) { 48 | // Antwort noch nicht vollständig, weiter empfangen 49 | } 50 | }); 51 | 52 | client.on('close', () => { 53 | console.log('🔒 Verbindung zum Server geschlossen.'); 54 | }); 55 | 56 | client.on('error', (err) => { 57 | reject(err); 58 | }); 59 | }); 60 | } 61 | 62 | // Funktion zum interaktiven Abfragen des Passworts (optional) 63 | function askPassword(query) { 64 | const rl = readline.createInterface({ 65 | input: process.stdin, 66 | output: process.stdout, 67 | terminal: true 68 | }); 69 | 70 | return new Promise((resolve) => { 71 | rl.question(query, (password) => { 72 | rl.close(); 73 | resolve(password); 74 | }); 75 | }); 76 | } 77 | 78 | // Hauptfunktion 79 | async function main() { 80 | const args = argv; 81 | const { serverIp, serverPort, email, password } = parseArguments(args); 82 | 83 | // Überprüfen, ob alle erforderlichen Parameter vorhanden sind 84 | if (!serverIp || !serverPort || !email || !password) { 85 | console.error('❌ ERROR: Fehlende erforderliche Parameter.'); 86 | console.log('Verwendung: node MCPLoginClient.js --server-ip <IP> --server-port <Port> --email <Email> --password <Passwort>'); 87 | exit(1); 88 | } 89 | 90 | const payload = { 91 | command: "login", 92 | arguments: { 93 | email: email, 94 | password: password 95 | } 96 | }; 97 | 98 | try { 99 | console.log('🔐 Logging in...'); 100 | const response = await sendRequest(serverIp, serverPort, payload); 101 | console.log('✅ Server Response:'); 102 | console.log(JSON.stringify(response, null, 4)); 103 | } catch (err) { 104 | console.error('❌ ERROR:', err.message); 105 | } 106 | } 107 | 108 | main(); 109 | ``` -------------------------------------------------------------------------------- /clients/Go/5.1 mcp_edit_user/MCPEditUserClient.go: -------------------------------------------------------------------------------- ```go 1 | package main 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "errors" 7 | "flag" 8 | "fmt" 9 | "io" 10 | "net" 11 | "os" 12 | ) 13 | 14 | type EditUserPayload struct { 15 | Command string `json:"command"` 16 | Token string `json:"token"` 17 | Arguments map[string]interface{} `json:"arguments"` 18 | } 19 | 20 | func sendEditUserRequest(serverIP string, serverPort int, token string, arguments map[string]interface{}) (string, error) { 21 | // Prepare the request payload 22 | payload := EditUserPayload{ 23 | Command: "edit_user", 24 | Token: token, 25 | Arguments: arguments, 26 | } 27 | 28 | // Convert the payload to JSON 29 | payloadJSON, err := json.Marshal(payload) 30 | if err != nil { 31 | return "", err 32 | } 33 | 34 | // Create a connection to the server 35 | conn, err := net.Dial("tcp", fmt.Sprintf("%s:%d", serverIP, serverPort)) 36 | if err != nil { 37 | return "", err 38 | } 39 | defer conn.Close() 40 | 41 | // Send the request 42 | _, err = conn.Write(payloadJSON) 43 | if err != nil { 44 | return "", err 45 | } 46 | 47 | // Receive the response 48 | var responseBuffer bytes.Buffer 49 | buf := make([]byte, 4096) 50 | for { 51 | n, err := conn.Read(buf) 52 | if err != nil { 53 | if errors.Is(err, io.EOF) { 54 | break 55 | } 56 | return "", err 57 | } 58 | responseBuffer.Write(buf[:n]) 59 | if n < 4096 { 60 | break 61 | } 62 | } 63 | 64 | return responseBuffer.String(), nil 65 | } 66 | 67 | func main() { 68 | serverIP := flag.String("server-ip", "", "IP address of the MCP server") 69 | serverPort := flag.Int("server-port", 0, "Port number of the MCP server") 70 | token := flag.String("token", "", "Authentication token") 71 | name := flag.String("name", "", "New name of the user") 72 | email := flag.String("email", "", "New email of the user") 73 | password := flag.String("password", "", "New password of the user") 74 | language := flag.String("language", "", "Preferred language of the user") 75 | timezone := flag.String("timezone", "", "Timezone of the user") 76 | roles := flag.String("roles", "", "Comma-separated list of roles to assign to the user") 77 | groups := flag.String("groups", "", "Comma-separated list of groups to assign to the user") 78 | usePublic := flag.Bool("usePublic", false, "Enable public knowledge base access") 79 | activateFtp := flag.Bool("activateFtp", false, "Activate FTP access") 80 | ftpPassword := flag.String("ftpPassword", "", "Password for FTP access") 81 | 82 | flag.Parse() 83 | 84 | if *serverIP == "" || *serverPort == 0 || *token == "" { 85 | fmt.Println("❌ ERROR: Required flags are missing.") 86 | flag.Usage() 87 | os.Exit(1) 88 | } 89 | 90 | // Prepare arguments map 91 | arguments := map[string]interface{}{} 92 | if *name != "" { 93 | arguments["name"] = *name 94 | } 95 | if *email != "" { 96 | arguments["email"] = *email 97 | } 98 | if *password != "" { 99 | arguments["password"] = *password 100 | } 101 | if *language != "" { 102 | arguments["language"] = *language 103 | } 104 | if *timezone != "" { 105 | arguments["timezone"] = *timezone 106 | } 107 | if *roles != "" { 108 | arguments["roles"] = *roles 109 | } 110 | if *groups != "" { 111 | arguments["groups"] = *groups 112 | } 113 | arguments["usePublic"] = *usePublic 114 | arguments["activateFtp"] = *activateFtp 115 | if *ftpPassword != "" { 116 | arguments["ftpPassword"] = *ftpPassword 117 | } 118 | 119 | // Send the request to edit the user 120 | fmt.Println("📤 Sending request to edit user...") 121 | response, err := sendEditUserRequest(*serverIP, *serverPort, *token, arguments) 122 | if err != nil { 123 | fmt.Printf("❌ ERROR: %v\n", err) 124 | os.Exit(1) 125 | } 126 | 127 | fmt.Println("✔️ Response from server:") 128 | fmt.Println(response) 129 | } ``` -------------------------------------------------------------------------------- /clients/Python/2.1 mcp_continue_chat/MCPContinueChatClient.py: -------------------------------------------------------------------------------- ```python 1 | import socket 2 | import ssl 3 | import json 4 | import argparse 5 | 6 | def send_continue_chat_request(server_ip, server_port, token, conversation_id, message, use_ssl=True, accept_self_signed=False): 7 | """ 8 | Sends a request to continue an existing chat to the MCP server. 9 | 10 | :param server_ip: IP address of the MCP server 11 | :param server_port: Port number of the MCP server 12 | :param token: Authentication token 13 | :param conversation_id: ID of the chat to continue 14 | :param message: Message to send in the chat 15 | :param use_ssl: Whether to use SSL/TLS for the connection 16 | :param accept_self_signed: Whether to accept self-signed certificates 17 | :return: Response from the server 18 | """ 19 | payload = { 20 | "command": "continue_chat", 21 | "token": token, 22 | "arguments": { 23 | "chatId": conversation_id, 24 | "question": message 25 | } 26 | } 27 | 28 | payload_json = json.dumps(payload) 29 | 30 | raw_socket = None 31 | client_socket = None 32 | 33 | try: 34 | raw_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 35 | raw_socket.settimeout(10) 36 | 37 | if use_ssl: 38 | context = ssl.create_default_context() 39 | if accept_self_signed: 40 | context.check_hostname = False 41 | context.verify_mode = ssl.CERT_NONE 42 | client_socket = context.wrap_socket(raw_socket, server_hostname=server_ip) 43 | else: 44 | client_socket = raw_socket 45 | 46 | client_socket.connect((server_ip, server_port)) 47 | client_socket.sendall(payload_json.encode('utf-8')) 48 | 49 | response = b"" 50 | while True: 51 | part = client_socket.recv(4096) 52 | if not part: 53 | break 54 | response += part 55 | 56 | return response.decode('utf-8') 57 | 58 | except ssl.SSLError: 59 | return "Error: Server and/or client may require TLS encryption. Please enable SSL/TLS." 60 | except Exception as e: 61 | return f"Error: {e}" 62 | 63 | finally: 64 | if client_socket is not None: 65 | try: 66 | client_socket.shutdown(socket.SHUT_RDWR) 67 | except: 68 | pass 69 | client_socket.close() 70 | 71 | if __name__ == "__main__": 72 | parser = argparse.ArgumentParser(description="Continue an existing chat with the MCP server.") 73 | parser.add_argument("--server-ip", required=True, help="IP address of the MCP server") 74 | parser.add_argument("--server-port", required=True, type=int, help="Port number of the MCP server") 75 | parser.add_argument("--token", required=True, help="Authentication token") 76 | parser.add_argument("--conversation-id", required=True, help="ID of the chat to continue") 77 | parser.add_argument("--message", required=True, help="Message to send in the chat") 78 | parser.add_argument("--use-ssl", action="store_true", help="Connect using SSL/TLS") 79 | parser.add_argument("--accept-self-signed", action="store_true", help="Accept self-signed certificates (disable certificate verification)") 80 | 81 | args = parser.parse_args() 82 | 83 | response = send_continue_chat_request( 84 | args.server_ip, 85 | args.server_port, 86 | args.token, 87 | args.conversation_id, 88 | args.message, 89 | use_ssl=args.use_ssl, 90 | accept_self_signed=args.accept_self_signed 91 | ) 92 | print("Response from server:", response) 93 | ``` -------------------------------------------------------------------------------- /clients/C++/1.1 mcp_logout/MCPLogoutClient.cpp: -------------------------------------------------------------------------------- ```cpp 1 | #include <iostream> 2 | #include <string> 3 | #include <map> 4 | #include <stdexcept> 5 | #include <json/json.h> // Für JSON-Bibliothek 6 | #include <winsock2.h> 7 | #include <ws2tcpip.h> 8 | 9 | #pragma comment(lib, "ws2_32.lib") // Winsock-Bibliothek verlinken 10 | 11 | // Argumente parsen 12 | std::map<std::string, std::string> parseArguments(int argc, char* argv[]) { 13 | std::map<std::string, std::string> args; 14 | for (int i = 1; i < argc; i++) { 15 | std::string key = argv[i]; 16 | if (i + 1 < argc) { 17 | args[key] = argv[++i]; 18 | } 19 | } 20 | return args; 21 | } 22 | 23 | // Funktion zum Senden der Logout-Anfrage 24 | std::string sendLogoutRequest(const std::string& serverIp, int serverPort, const std::string& token) { 25 | // JSON-Payload erstellen 26 | Json::Value payload; 27 | payload["command"] = "logout"; 28 | payload["token"] = token; 29 | 30 | Json::StreamWriterBuilder writer; 31 | std::string payloadJson = Json::writeString(writer, payload); 32 | 33 | // Winsock initialisieren 34 | WSADATA wsaData; 35 | if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) { 36 | throw std::runtime_error("Failed to initialize Winsock."); 37 | } 38 | 39 | // Socket erstellen 40 | SOCKET sock = socket(AF_INET, SOCK_STREAM, 0); 41 | if (sock == INVALID_SOCKET) { 42 | WSACleanup(); 43 | throw std::runtime_error("Failed to create socket."); 44 | } 45 | 46 | // Server-Adresse konfigurieren 47 | sockaddr_in serverAddr; 48 | serverAddr.sin_family = AF_INET; 49 | serverAddr.sin_port = htons(serverPort); 50 | if (inet_pton(AF_INET, serverIp.c_str(), &serverAddr.sin_addr) <= 0) { 51 | closesocket(sock); 52 | WSACleanup(); 53 | throw std::runtime_error("Invalid server IP address."); 54 | } 55 | 56 | // Verbindung herstellen 57 | if (connect(sock, (sockaddr*)&serverAddr, sizeof(serverAddr)) < 0) { 58 | closesocket(sock); 59 | WSACleanup(); 60 | throw std::runtime_error("Connection failed."); 61 | } 62 | 63 | // Daten senden 64 | if (send(sock, payloadJson.c_str(), payloadJson.size(), 0) < 0) { 65 | closesocket(sock); 66 | WSACleanup(); 67 | throw std::runtime_error("Failed to send data."); 68 | } 69 | 70 | // Antwort empfangen 71 | char buffer[4096]; 72 | int bytesRead = recv(sock, buffer, sizeof(buffer) - 1, 0); 73 | if (bytesRead < 0) { 74 | closesocket(sock); 75 | WSACleanup(); 76 | throw std::runtime_error("Failed to receive data."); 77 | } 78 | 79 | buffer[bytesRead] = '\0'; // Antwort null-terminieren 80 | 81 | // Socket schließen 82 | closesocket(sock); 83 | WSACleanup(); 84 | 85 | return std::string(buffer); 86 | } 87 | 88 | int main(int argc, char* argv[]) { 89 | try { 90 | auto args = parseArguments(argc, argv); 91 | 92 | // Erforderliche Parameter extrahieren 93 | std::string serverIp = args["--server-ip"]; 94 | int serverPort = std::stoi(args["--server-port"]); 95 | std::string token = args["--token"]; 96 | 97 | if (serverIp.empty() || serverPort == 0 || token.empty()) { 98 | std::cerr << "❌ ERROR: Missing required parameters.\n"; 99 | return 1; 100 | } 101 | 102 | std::cout << "🔒 Sending logout request...\n"; 103 | 104 | // Logout-Anfrage senden und Antwort erhalten 105 | std::string response = sendLogoutRequest(serverIp, serverPort, token); 106 | 107 | std::cout << "Response from server:\n" << response << "\n"; 108 | } catch (const std::exception& e) { 109 | std::cerr << "❌ ERROR: " << e.what() << "\n"; 110 | return 1; 111 | } 112 | 113 | return 0; 114 | } 115 | ``` -------------------------------------------------------------------------------- /agents/ChatBotAgent/html/Logo_light.svg: -------------------------------------------------------------------------------- ``` 1 | <svg width="3254" height="1025" viewBox="0 0 3254 1025" fill="none" xmlns="http://www.w3.org/2000/svg"> 2 | <path d="M2839.93 778.987V152.894H2594.38V13.3905H3254V152.894H3007.34V778.987H2839.93Z" fill="#110930"/> 3 | <path d="M1898.85 778.987V13.3905H2297.3C2352.36 13.3905 2398.12 23.8068 2434.58 44.6394C2471.79 64.7279 2499.69 93.3727 2518.29 130.574C2537.64 167.031 2547.31 210.556 2547.31 261.149C2547.31 311.742 2537.26 356.012 2517.17 393.957C2497.83 431.158 2469.18 460.174 2431.23 481.007C2393.29 501.84 2346.78 512.256 2291.72 512.256H2065.15V778.987H1898.85ZM2065.15 376.1H2269.4C2304.37 376.1 2331.16 366.056 2349.76 345.967C2369.11 325.879 2378.78 297.978 2378.78 262.265C2378.78 237.713 2374.69 217.252 2366.5 200.884C2358.32 184.515 2346.04 171.867 2329.67 162.939C2314.04 154.01 2293.95 149.546 2269.4 149.546H2065.15V376.1Z" fill="#110930"/> 4 | <path d="M1364.62 792.381C1244.08 792.381 1151.07 760.388 1085.59 696.402C1020.86 631.673 988.492 531.602 988.492 396.19C988.492 306.164 1004.12 232.134 1035.37 174.101C1066.62 115.323 1112.01 71.7979 1171.53 43.5251C1231.06 14.5084 1302.49 0 1385.82 0C1435.68 0 1482.55 5.58013 1526.45 16.7404C1570.35 27.9007 1609.04 45.0131 1642.53 68.0778C1676.75 91.1424 1703.17 120.159 1721.77 155.128C1741.12 189.353 1750.79 230.274 1750.79 277.891H1582.26C1582.26 254.827 1577.05 234.366 1566.63 216.51C1556.96 198.653 1543.19 183.773 1525.34 171.869C1507.48 159.964 1487.02 151.036 1463.95 145.084C1440.88 139.132 1416.7 136.156 1391.4 136.156C1352.71 136.156 1318.86 141.364 1289.84 151.78C1260.82 161.452 1236.64 176.705 1217.29 197.537C1198.69 217.626 1184.55 242.922 1174.88 273.427C1165.21 303.932 1160.37 339.273 1160.37 379.45V412.931C1160.37 468.732 1168.56 514.49 1184.93 550.203C1201.3 585.916 1225.85 612.7 1258.59 630.557C1291.33 647.669 1331.88 656.225 1380.24 656.225C1420.42 656.225 1455.77 650.273 1486.27 638.369C1517.52 625.721 1541.71 607.864 1558.82 584.799C1576.68 561.735 1585.61 533.462 1585.61 499.981V492.169H1356.81V364.942H1750.79V778.989H1641.41L1626.9 696.402C1604.58 717.979 1580.4 735.836 1554.36 749.972C1529.06 764.108 1500.78 774.525 1469.53 781.221C1438.28 788.661 1403.31 792.381 1364.62 792.381Z" fill="#110930"/> 5 | <path fill-rule="evenodd" clip-rule="evenodd" d="M1 84.6547C1 44.6338 33.2944 12.1904 73.1316 12.1904H481.877C694.342 12.1904 866.579 185.222 866.579 398.667C866.579 612.112 694.342 785.143 481.877 785.143H248.9L42.9462 1015.92C28.2213 1032.42 1 1021.96 1 999.797V84.6547ZM215.784 244.691C215.784 235.18 223.477 227.469 232.967 227.469H481.34C575.48 227.469 651.795 303.96 651.795 398.317C651.795 492.673 575.48 569.164 481.34 569.164H354.546L244.825 688.762C226.538 700.952 215.784 687.755 215.784 676.576V244.691Z" fill="url(#paint0_linear_3311_10242)" stroke="url(#paint1_linear_3311_10242)" stroke-opacity="0.6"/> 6 | <defs> 7 | <linearGradient id="paint0_linear_3311_10242" x1="0.999982" y1="1024" x2="891.762" y2="34.8689" gradientUnits="userSpaceOnUse"> 8 | <stop stop-color="#0000F6"/> 9 | <stop offset="0.5" stop-color="#7F017B"/> 10 | <stop offset="1" stop-color="#FE0100"/> 11 | </linearGradient> 12 | <linearGradient id="paint1_linear_3311_10242" x1="-35.5737" y1="963.048" x2="159.462" y2="-195.052" gradientUnits="userSpaceOnUse"> 13 | <stop stop-color="white"/> 14 | <stop offset="0.884335" stop-color="white" stop-opacity="0"/> 15 | <stop offset="1" stop-color="white"/> 16 | </linearGradient> 17 | </defs> 18 | </svg> 19 | ``` -------------------------------------------------------------------------------- /clients/C# .Net/3.0 mcp_create_source/Program.cs: -------------------------------------------------------------------------------- ```csharp 1 | using System; 2 | using System.Net.Sockets; 3 | using System.Text; 4 | using Newtonsoft.Json; 5 | using System.Collections.Generic; 6 | 7 | namespace MCPCreateSourceClient 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | if (args.Length < 8) 14 | { 15 | Console.WriteLine("Usage: --server-ip <IP> --server-port <PORT> --token <TOKEN> --name <NAME> --content <CONTENT> [--groups <GROUP1 GROUP2 ...>]"); 16 | return; 17 | } 18 | 19 | string serverIp = GetArgument(args, "--server-ip"); 20 | int serverPort = int.Parse(GetArgument(args, "--server-port")); 21 | string token = GetArgument(args, "--token"); 22 | string name = GetArgument(args, "--name"); 23 | string content = GetArgument(args, "--content"); 24 | List<string> groups = GetArgumentList(args, "--groups"); 25 | 26 | Console.WriteLine("📤 Sending request to create a new source..."); 27 | 28 | var payload = new 29 | { 30 | command = "create_source", 31 | token = token, 32 | arguments = new 33 | { 34 | name = name, 35 | content = content, 36 | groups = groups 37 | } 38 | }; 39 | 40 | string response = SendRequest(serverIp, serverPort, payload); 41 | 42 | Console.WriteLine("✔️ Response from server:"); 43 | Console.WriteLine(response); 44 | } 45 | 46 | static string GetArgument(string[] args, string key) 47 | { 48 | int index = Array.IndexOf(args, key); 49 | return index >= 0 && index < args.Length - 1 ? args[index + 1] : null; 50 | } 51 | 52 | static List<string> GetArgumentList(string[] args, string key) 53 | { 54 | int index = Array.IndexOf(args, key); 55 | if (index >= 0 && index < args.Length - 1) 56 | { 57 | var groups = new List<string>(); 58 | for (int i = index + 1; i < args.Length; i++) 59 | { 60 | if (args[i].StartsWith("--")) break; 61 | groups.Add(args[i]); 62 | } 63 | return groups; 64 | } 65 | return new List<string>(); 66 | } 67 | 68 | static string SendRequest(string serverIp, int serverPort, object payload) 69 | { 70 | string payloadJson = JsonConvert.SerializeObject(payload); 71 | 72 | try 73 | { 74 | using (TcpClient client = new TcpClient(serverIp, serverPort)) 75 | { 76 | NetworkStream stream = client.GetStream(); 77 | 78 | // Send payload 79 | byte[] data = Encoding.UTF8.GetBytes(payloadJson); 80 | stream.Write(data, 0, data.Length); 81 | 82 | // Receive response 83 | byte[] buffer = new byte[4096]; 84 | int bytesRead; 85 | StringBuilder response = new StringBuilder(); 86 | 87 | do 88 | { 89 | bytesRead = stream.Read(buffer, 0, buffer.Length); 90 | response.Append(Encoding.UTF8.GetString(buffer, 0, bytesRead)); 91 | } while (bytesRead == buffer.Length); 92 | 93 | return response.ToString(); 94 | } 95 | } 96 | catch (Exception e) 97 | { 98 | return $"Error: {e.Message}"; 99 | } 100 | } 101 | } 102 | } 103 | ``` -------------------------------------------------------------------------------- /clients/C# .Net/Code Archiv/mcp_create_source.cs: -------------------------------------------------------------------------------- ```csharp 1 | using System; 2 | using System.Net.Sockets; 3 | using System.Text; 4 | using Newtonsoft.Json; 5 | using System.Collections.Generic; 6 | 7 | namespace MCPCreateSourceClient 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | if (args.Length < 8) 14 | { 15 | Console.WriteLine("Usage: --server-ip <IP> --server-port <PORT> --token <TOKEN> --name <NAME> --content <CONTENT> [--groups <GROUP1 GROUP2 ...>]"); 16 | return; 17 | } 18 | 19 | string serverIp = GetArgument(args, "--server-ip"); 20 | int serverPort = int.Parse(GetArgument(args, "--server-port")); 21 | string token = GetArgument(args, "--token"); 22 | string name = GetArgument(args, "--name"); 23 | string content = GetArgument(args, "--content"); 24 | List<string> groups = GetArgumentList(args, "--groups"); 25 | 26 | Console.WriteLine("📤 Sending request to create a new source..."); 27 | 28 | var payload = new 29 | { 30 | command = "create_source", 31 | token = token, 32 | arguments = new 33 | { 34 | name = name, 35 | content = content, 36 | groups = groups 37 | } 38 | }; 39 | 40 | string response = SendRequest(serverIp, serverPort, payload); 41 | 42 | Console.WriteLine("✔️ Response from server:"); 43 | Console.WriteLine(response); 44 | } 45 | 46 | static string GetArgument(string[] args, string key) 47 | { 48 | int index = Array.IndexOf(args, key); 49 | return index >= 0 && index < args.Length - 1 ? args[index + 1] : null; 50 | } 51 | 52 | static List<string> GetArgumentList(string[] args, string key) 53 | { 54 | int index = Array.IndexOf(args, key); 55 | if (index >= 0 && index < args.Length - 1) 56 | { 57 | var groups = new List<string>(); 58 | for (int i = index + 1; i < args.Length; i++) 59 | { 60 | if (args[i].StartsWith("--")) break; 61 | groups.Add(args[i]); 62 | } 63 | return groups; 64 | } 65 | return new List<string>(); 66 | } 67 | 68 | static string SendRequest(string serverIp, int serverPort, object payload) 69 | { 70 | string payloadJson = JsonConvert.SerializeObject(payload); 71 | 72 | try 73 | { 74 | using (TcpClient client = new TcpClient(serverIp, serverPort)) 75 | { 76 | NetworkStream stream = client.GetStream(); 77 | 78 | // Send payload 79 | byte[] data = Encoding.UTF8.GetBytes(payloadJson); 80 | stream.Write(data, 0, data.Length); 81 | 82 | // Receive response 83 | byte[] buffer = new byte[4096]; 84 | int bytesRead; 85 | StringBuilder response = new StringBuilder(); 86 | 87 | do 88 | { 89 | bytesRead = stream.Read(buffer, 0, buffer.Length); 90 | response.Append(Encoding.UTF8.GetString(buffer, 0, bytesRead)); 91 | } while (bytesRead == buffer.Length); 92 | 93 | return response.ToString(); 94 | } 95 | } 96 | catch (Exception e) 97 | { 98 | return $"Error: {e.Message}"; 99 | } 100 | } 101 | } 102 | } 103 | ``` -------------------------------------------------------------------------------- /clients/Java/4.0 mcp_list_groups/MCPListGroupsClient.java: -------------------------------------------------------------------------------- ```java 1 | import org.json.JSONObject; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.io.OutputStream; 6 | import java.net.Socket; 7 | import java.nio.charset.StandardCharsets; 8 | 9 | public class MCPListGroupsClient { 10 | 11 | public static void main(String[] args) { 12 | // Minimaler Check: Wir erwarten mindestens 3 "richtige" Parameter 13 | // (d.h. --server-ip <IP>, --server-port <PORT>, --token <TOKEN>) 14 | if (args.length < 3 * 2) { // 3 Schlüssel + 3 Werte = 6 Strings 15 | printUsage(); 16 | return; 17 | } 18 | 19 | // Argumente auslesen 20 | String serverIp = getArgument(args, "--server-ip"); 21 | String portStr = getArgument(args, "--server-port"); 22 | String token = getArgument(args, "--token"); 23 | 24 | if (serverIp == null || portStr == null || token == null) { 25 | printUsage(); 26 | return; 27 | } 28 | 29 | int serverPort = Integer.parseInt(portStr); 30 | 31 | System.out.println("📄 Abrufen der Gruppen..."); 32 | 33 | // JSON-Payload erzeugen 34 | JSONObject payload = new JSONObject(); 35 | payload.put("command", "list_groups"); 36 | payload.put("token", token); 37 | 38 | // Request an den Server senden 39 | String response = sendRequest(serverIp, serverPort, payload); 40 | System.out.println("✔️ Antwort:"); 41 | System.out.println(response); 42 | } 43 | 44 | /** 45 | * Extrahiert den Wert für ein bestimmtes Argument (z.B. --server-ip 127.0.0.1). 46 | * Gibt null zurück, wenn der Schlüssel nicht gefunden wird oder kein Wert dahinter steht. 47 | */ 48 | private static String getArgument(String[] args, String key) { 49 | for (int i = 0; i < args.length - 1; i++) { 50 | if (args[i].equals(key)) { 51 | return args[i + 1]; 52 | } 53 | } 54 | return null; 55 | } 56 | 57 | /** 58 | * Stellt eine Socket-Verbindung her, sendet das JSON und empfängt die Antwort. 59 | */ 60 | private static String sendRequest(String serverIp, int serverPort, JSONObject payload) { 61 | String payloadJson = payload.toString(); 62 | 63 | try (Socket client = new Socket(serverIp, serverPort)) { 64 | // Daten senden 65 | OutputStream out = client.getOutputStream(); 66 | byte[] data = payloadJson.getBytes(StandardCharsets.UTF_8); 67 | out.write(data); 68 | out.flush(); 69 | 70 | // Antwort empfangen 71 | InputStream in = client.getInputStream(); 72 | byte[] buffer = new byte[4096]; 73 | StringBuilder responseBuilder = new StringBuilder(); 74 | 75 | int bytesRead; 76 | do { 77 | bytesRead = in.read(buffer); 78 | if (bytesRead > 0) { 79 | responseBuilder.append(new String(buffer, 0, bytesRead, StandardCharsets.UTF_8)); 80 | } 81 | } while (bytesRead == buffer.length); 82 | 83 | return responseBuilder.toString(); 84 | 85 | } catch (IOException e) { 86 | return "Error: " + e.getMessage(); 87 | } 88 | } 89 | 90 | /** 91 | * Gibt die erwartete Aufrufstruktur aus. 92 | */ 93 | private static void printUsage() { 94 | System.out.println("Usage: --server-ip <IP> --server-port <PORT> --token <TOKEN>"); 95 | System.out.println(); 96 | System.out.println("Beispiel:"); 97 | System.out.println(" java -cp .;json-20241224.jar MCPListGroupsClient \\"); 98 | System.out.println(" --server-ip 127.0.0.1 --server-port 1234 --token MyToken"); 99 | } 100 | } 101 | ``` -------------------------------------------------------------------------------- /clients/Go/5.0 mcp_store_user/MCPStoreUserClient.go: -------------------------------------------------------------------------------- ```go 1 | package main 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "errors" 7 | "flag" 8 | "fmt" 9 | "io" 10 | "net" 11 | "os" 12 | ) 13 | 14 | type StoreUserPayload struct { 15 | Command string `json:"command"` 16 | Token string `json:"token"` 17 | Arguments map[string]interface{} `json:"arguments"` 18 | } 19 | 20 | func sendStoreUserRequest(serverIP string, serverPort int, token, name, email, password, language, timezone string, roles, groups []string, usePublic, activateFtp bool, ftpPassword string) (string, error) { 21 | // Prepare the request payload 22 | payload := StoreUserPayload{ 23 | Command: "store_user", 24 | Token: token, 25 | Arguments: map[string]interface{}{ 26 | "name": name, 27 | "email": email, 28 | "password": password, 29 | "language": language, 30 | "timezone": timezone, 31 | "roles": roles, 32 | "groups": groups, 33 | "usePublic": usePublic, 34 | "activateFtp": activateFtp, 35 | "ftpPassword": ftpPassword, 36 | }, 37 | } 38 | 39 | // Convert the payload to JSON 40 | payloadJSON, err := json.Marshal(payload) 41 | if err != nil { 42 | return "", err 43 | } 44 | 45 | // Create a connection to the server 46 | conn, err := net.Dial("tcp", fmt.Sprintf("%s:%d", serverIP, serverPort)) 47 | if err != nil { 48 | return "", err 49 | } 50 | defer conn.Close() 51 | 52 | // Send the request 53 | _, err = conn.Write(payloadJSON) 54 | if err != nil { 55 | return "", err 56 | } 57 | 58 | // Receive the response 59 | var responseBuffer bytes.Buffer 60 | buf := make([]byte, 4096) 61 | for { 62 | n, err := conn.Read(buf) 63 | if err != nil { 64 | if errors.Is(err, io.EOF) { 65 | break 66 | } 67 | return "", err 68 | } 69 | responseBuffer.Write(buf[:n]) 70 | if n < 4096 { 71 | break 72 | } 73 | } 74 | 75 | return responseBuffer.String(), nil 76 | } 77 | 78 | func main() { 79 | serverIP := flag.String("server-ip", "", "IP address of the MCP server") 80 | serverPort := flag.Int("server-port", 0, "Port number of the MCP server") 81 | token := flag.String("token", "", "Authentication token") 82 | name := flag.String("name", "", "Name of the user") 83 | email := flag.String("email", "", "Email of the user") 84 | password := flag.String("password", "", "Password for the user") 85 | language := flag.String("language", "en", "Language code (optional)") 86 | timezone := flag.String("timezone", "Europe/Berlin", "Timezone (optional)") 87 | roles := flag.String("roles", "", "Comma-separated list of roles for the user (optional)") 88 | groups := flag.String("groups", "", "Comma-separated list of groups for the user (optional)") 89 | usePublic := flag.Bool("usePublic", false, "Use the public knowledge base") 90 | activateFtp := flag.Bool("activateFtp", false, "Activate FTP for the user") 91 | ftpPassword := flag.String("ftpPassword", "", "FTP password for the user (optional)") 92 | 93 | flag.Parse() 94 | 95 | if *serverIP == "" || *serverPort == 0 || *token == "" || *name == "" || *email == "" || *password == "" { 96 | fmt.Println("❌ ERROR: Required flags are missing.") 97 | flag.Usage() 98 | os.Exit(1) 99 | } 100 | 101 | // Convert roles and groups to slices 102 | roleList := []string{} 103 | if *roles != "" { 104 | roleList = append(roleList, *roles) 105 | } 106 | 107 | groupList := []string{} 108 | if *groups != "" { 109 | groupList = append(groupList, *groups) 110 | } 111 | 112 | // Send the request to store the user 113 | fmt.Println("📤 Sending request to create a new user...") 114 | response, err := sendStoreUserRequest(*serverIP, *serverPort, *token, *name, *email, *password, *language, *timezone, roleList, groupList, *usePublic, *activateFtp, *ftpPassword) 115 | if err != nil { 116 | fmt.Printf("❌ ERROR: %v\n", err) 117 | os.Exit(1) 118 | } 119 | 120 | fmt.Println("✔️ Response from server:") 121 | fmt.Println(response) 122 | } ``` -------------------------------------------------------------------------------- /clients/Python/4.2 mcp_delete_group/MCPDeleteGroupClient.py: -------------------------------------------------------------------------------- ```python 1 | import socket 2 | import ssl 3 | import json 4 | import argparse 5 | 6 | def send_delete_group_request(server_ip, server_port, token, group_name, use_ssl=True, accept_self_signed=False): 7 | """ 8 | Sends a request to delete an existing group to the MCP server. 9 | 10 | :param server_ip: IP address of the MCP server 11 | :param server_port: Port number of the MCP server 12 | :param token: Authentication token 13 | :param group_name: Name of the group to delete 14 | :param use_ssl: Whether to use SSL/TLS for the connection 15 | :param accept_self_signed: Whether to accept self-signed certificates 16 | :return: Response from the server 17 | """ 18 | # Prepare the request payload 19 | payload = { 20 | "command": "delete_group", 21 | "token": token, 22 | "arguments": { 23 | "groupName": group_name 24 | } 25 | } 26 | 27 | # Convert the payload to a JSON string 28 | payload_json = json.dumps(payload) 29 | 30 | raw_socket = None 31 | client_socket = None 32 | 33 | try: 34 | # Create a socket object 35 | raw_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 36 | raw_socket.settimeout(10) 37 | 38 | # Establish SSL/TLS connection if required 39 | if use_ssl: 40 | context = ssl.create_default_context() 41 | if accept_self_signed: 42 | context.check_hostname = False 43 | context.verify_mode = ssl.CERT_NONE 44 | client_socket = context.wrap_socket(raw_socket, server_hostname=server_ip) 45 | else: 46 | client_socket = raw_socket 47 | 48 | # Connect to the server 49 | client_socket.connect((server_ip, server_port)) 50 | 51 | # Send the request 52 | client_socket.sendall(payload_json.encode('utf-8')) 53 | 54 | # Receive the response 55 | response = b"" 56 | while True: 57 | part = client_socket.recv(4096) 58 | if not part: 59 | break 60 | response += part 61 | 62 | # Decode the response 63 | return response.decode('utf-8') 64 | 65 | except ssl.SSLError: 66 | return "Error: Server and/or client may require TLS encryption. Please enable SSL/TLS." 67 | except Exception as e: 68 | return f"Error: {e}" 69 | 70 | finally: 71 | if client_socket is not None: 72 | try: 73 | client_socket.shutdown(socket.SHUT_RDWR) 74 | except: 75 | pass 76 | client_socket.close() 77 | 78 | if __name__ == "__main__": 79 | # Argument parser for command-line arguments 80 | parser = argparse.ArgumentParser(description="Send a request to delete an existing group to the MCP server.") 81 | parser.add_argument("--server-ip", required=True, help="IP address of the MCP server") 82 | parser.add_argument("--server-port", required=True, type=int, help="Port number of the MCP server") 83 | parser.add_argument("--token", required=True, help="Authentication token") 84 | parser.add_argument("--group-name", required=True, help="Name of the group to delete") 85 | parser.add_argument("--use-ssl", action="store_true", help="Connect using SSL/TLS") 86 | parser.add_argument("--accept-self-signed", action="store_true", help="Accept self-signed certificates (disable certificate verification)") 87 | 88 | args = parser.parse_args() 89 | 90 | # Send the delete group request and print the response 91 | response = send_delete_group_request( 92 | args.server_ip, 93 | args.server_port, 94 | args.token, 95 | args.group_name, 96 | use_ssl=args.use_ssl, 97 | accept_self_signed=args.accept_self_signed 98 | ) 99 | print("Response from server:", response) 100 | ``` -------------------------------------------------------------------------------- /clients/C++/4.0 mcp_list_groups/MCPListGroupsClient.cpp: -------------------------------------------------------------------------------- ```cpp 1 | #include <iostream> 2 | #include <string> 3 | #include <map> 4 | #include <sstream> 5 | #include <stdexcept> 6 | #include <json/json.h> 7 | #include <winsock2.h> 8 | #include <ws2tcpip.h> 9 | 10 | #pragma comment(lib, "ws2_32.lib") // Winsock-Bibliothek verlinken 11 | 12 | // Funktion zum Argument-Parsing 13 | std::map<std::string, std::string> parseArguments(int argc, char* argv[]) { 14 | std::map<std::string, std::string> args; 15 | for (int i = 1; i < argc; ++i) { 16 | std::string key = argv[i]; 17 | if (i + 1 < argc && key.rfind("--", 0) == 0) { 18 | args[key] = argv[++i]; 19 | } 20 | } 21 | return args; 22 | } 23 | 24 | // Funktion zum Senden der Anfrage 25 | std::string sendRequest(const std::string& serverIp, int serverPort, const Json::Value& payload) { 26 | Json::StreamWriterBuilder writer; 27 | std::string payloadJson = Json::writeString(writer, payload); 28 | 29 | // Winsock initialisieren 30 | WSADATA wsaData; 31 | if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) { 32 | throw std::runtime_error("Failed to initialize Winsock."); 33 | } 34 | 35 | // Socket erstellen 36 | SOCKET sock = socket(AF_INET, SOCK_STREAM, 0); 37 | if (sock == INVALID_SOCKET) { 38 | WSACleanup(); 39 | throw std::runtime_error("Failed to create socket."); 40 | } 41 | 42 | // Server-Adresse konfigurieren 43 | sockaddr_in serverAddr; 44 | serverAddr.sin_family = AF_INET; 45 | serverAddr.sin_port = htons(serverPort); 46 | if (inet_pton(AF_INET, serverIp.c_str(), &serverAddr.sin_addr) <= 0) { 47 | closesocket(sock); 48 | WSACleanup(); 49 | throw std::runtime_error("Invalid server IP address."); 50 | } 51 | 52 | // Verbindung herstellen 53 | if (connect(sock, (sockaddr*)&serverAddr, sizeof(serverAddr)) < 0) { 54 | closesocket(sock); 55 | WSACleanup(); 56 | throw std::runtime_error("Connection failed."); 57 | } 58 | 59 | // Daten senden 60 | if (send(sock, payloadJson.c_str(), payloadJson.size(), 0) < 0) { 61 | closesocket(sock); 62 | WSACleanup(); 63 | throw std::runtime_error("Failed to send data."); 64 | } 65 | 66 | // Antwort empfangen 67 | char buffer[4096]; 68 | int bytesRead; 69 | std::ostringstream response; 70 | 71 | do { 72 | bytesRead = recv(sock, buffer, sizeof(buffer) - 1, 0); 73 | if (bytesRead > 0) { 74 | buffer[bytesRead] = '\0'; // Null-terminieren 75 | response << buffer; 76 | } 77 | } while (bytesRead == sizeof(buffer) - 1); 78 | 79 | // Socket schließen 80 | closesocket(sock); 81 | WSACleanup(); 82 | 83 | return response.str(); 84 | } 85 | 86 | int main(int argc, char* argv[]) { 87 | try { 88 | auto args = parseArguments(argc, argv); 89 | 90 | // Argumente extrahieren 91 | std::string serverIp = args["--server-ip"]; 92 | int serverPort = std::stoi(args["--server-port"]); 93 | std::string token = args["--token"]; 94 | 95 | // Überprüfen, ob alle erforderlichen Parameter angegeben sind 96 | if (serverIp.empty() || serverPort == 0 || token.empty()) { 97 | std::cerr << "Usage: MCPListGroupsClient --server-ip <IP> --server-port <PORT> --token <TOKEN>\n"; 98 | return 1; 99 | } 100 | 101 | std::cout << "📄 Retrieving list of groups...\n"; 102 | 103 | // JSON-Payload erstellen 104 | Json::Value payload; 105 | payload["command"] = "list_groups"; 106 | payload["token"] = token; 107 | 108 | // Anfrage senden und Antwort erhalten 109 | std::string response = sendRequest(serverIp, serverPort, payload); 110 | 111 | std::cout << "✔️ Response from server:\n" << response << "\n"; 112 | } catch (const std::exception& e) { 113 | std::cerr << "❌ ERROR: " << e.what() << "\n"; 114 | return 1; 115 | } 116 | 117 | return 0; 118 | } 119 | ``` -------------------------------------------------------------------------------- /clients/C# .Net/2.0 mcp_chat/obj/project.assets.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "version": 3, 3 | "targets": { 4 | "net9.0": { 5 | "Newtonsoft.Json/13.0.3": { 6 | "type": "package", 7 | "compile": { 8 | "lib/net6.0/Newtonsoft.Json.dll": { 9 | "related": ".xml" 10 | } 11 | }, 12 | "runtime": { 13 | "lib/net6.0/Newtonsoft.Json.dll": { 14 | "related": ".xml" 15 | } 16 | } 17 | } 18 | } 19 | }, 20 | "libraries": { 21 | "Newtonsoft.Json/13.0.3": { 22 | "sha512": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", 23 | "type": "package", 24 | "path": "newtonsoft.json/13.0.3", 25 | "files": [ 26 | ".nupkg.metadata", 27 | ".signature.p7s", 28 | "LICENSE.md", 29 | "README.md", 30 | "lib/net20/Newtonsoft.Json.dll", 31 | "lib/net20/Newtonsoft.Json.xml", 32 | "lib/net35/Newtonsoft.Json.dll", 33 | "lib/net35/Newtonsoft.Json.xml", 34 | "lib/net40/Newtonsoft.Json.dll", 35 | "lib/net40/Newtonsoft.Json.xml", 36 | "lib/net45/Newtonsoft.Json.dll", 37 | "lib/net45/Newtonsoft.Json.xml", 38 | "lib/net6.0/Newtonsoft.Json.dll", 39 | "lib/net6.0/Newtonsoft.Json.xml", 40 | "lib/netstandard1.0/Newtonsoft.Json.dll", 41 | "lib/netstandard1.0/Newtonsoft.Json.xml", 42 | "lib/netstandard1.3/Newtonsoft.Json.dll", 43 | "lib/netstandard1.3/Newtonsoft.Json.xml", 44 | "lib/netstandard2.0/Newtonsoft.Json.dll", 45 | "lib/netstandard2.0/Newtonsoft.Json.xml", 46 | "newtonsoft.json.13.0.3.nupkg.sha512", 47 | "newtonsoft.json.nuspec", 48 | "packageIcon.png" 49 | ] 50 | } 51 | }, 52 | "projectFileDependencyGroups": { 53 | "net9.0": [ 54 | "Newtonsoft.Json >= 13.0.3" 55 | ] 56 | }, 57 | "packageFolders": { 58 | "C:\\Users\\uwuertz\\.nuget\\packages\\": {} 59 | }, 60 | "project": { 61 | "version": "1.0.0", 62 | "restore": { 63 | "projectUniqueName": "C:\\Users\\uwuertz\\AI\\mcp-client\\mcp_chat\\mcp_chat.csproj", 64 | "projectName": "mcp_chat", 65 | "projectPath": "C:\\Users\\uwuertz\\AI\\mcp-client\\mcp_chat\\mcp_chat.csproj", 66 | "packagesPath": "C:\\Users\\uwuertz\\.nuget\\packages\\", 67 | "outputPath": "C:\\Users\\uwuertz\\AI\\mcp-client\\mcp_chat\\obj\\", 68 | "projectStyle": "PackageReference", 69 | "configFilePaths": [ 70 | "C:\\Users\\uwuertz\\AppData\\Roaming\\NuGet\\NuGet.Config" 71 | ], 72 | "originalTargetFrameworks": [ 73 | "net9.0" 74 | ], 75 | "sources": { 76 | "https://api.nuget.org/v3/index.json": {} 77 | }, 78 | "frameworks": { 79 | "net9.0": { 80 | "targetAlias": "net9.0", 81 | "projectReferences": {} 82 | } 83 | }, 84 | "warningProperties": { 85 | "warnAsError": [ 86 | "NU1605" 87 | ] 88 | }, 89 | "restoreAuditProperties": { 90 | "enableAudit": "true", 91 | "auditLevel": "low", 92 | "auditMode": "direct" 93 | }, 94 | "SdkAnalysisLevel": "9.0.100" 95 | }, 96 | "frameworks": { 97 | "net9.0": { 98 | "targetAlias": "net9.0", 99 | "dependencies": { 100 | "Newtonsoft.Json": { 101 | "target": "Package", 102 | "version": "[13.0.3, )" 103 | } 104 | }, 105 | "imports": [ 106 | "net461", 107 | "net462", 108 | "net47", 109 | "net471", 110 | "net472", 111 | "net48", 112 | "net481" 113 | ], 114 | "assetTargetFallback": true, 115 | "warn": true, 116 | "frameworkReferences": { 117 | "Microsoft.NETCore.App": { 118 | "privateAssets": "all" 119 | } 120 | }, 121 | "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.101/PortableRuntimeIdentifierGraph.json" 122 | } 123 | } 124 | } 125 | } ``` -------------------------------------------------------------------------------- /clients/C# .Net/1.0 mcp_login/obj/project.assets.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "version": 3, 3 | "targets": { 4 | "net9.0": { 5 | "Newtonsoft.Json/13.0.3": { 6 | "type": "package", 7 | "compile": { 8 | "lib/net6.0/Newtonsoft.Json.dll": { 9 | "related": ".xml" 10 | } 11 | }, 12 | "runtime": { 13 | "lib/net6.0/Newtonsoft.Json.dll": { 14 | "related": ".xml" 15 | } 16 | } 17 | } 18 | } 19 | }, 20 | "libraries": { 21 | "Newtonsoft.Json/13.0.3": { 22 | "sha512": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", 23 | "type": "package", 24 | "path": "newtonsoft.json/13.0.3", 25 | "files": [ 26 | ".nupkg.metadata", 27 | ".signature.p7s", 28 | "LICENSE.md", 29 | "README.md", 30 | "lib/net20/Newtonsoft.Json.dll", 31 | "lib/net20/Newtonsoft.Json.xml", 32 | "lib/net35/Newtonsoft.Json.dll", 33 | "lib/net35/Newtonsoft.Json.xml", 34 | "lib/net40/Newtonsoft.Json.dll", 35 | "lib/net40/Newtonsoft.Json.xml", 36 | "lib/net45/Newtonsoft.Json.dll", 37 | "lib/net45/Newtonsoft.Json.xml", 38 | "lib/net6.0/Newtonsoft.Json.dll", 39 | "lib/net6.0/Newtonsoft.Json.xml", 40 | "lib/netstandard1.0/Newtonsoft.Json.dll", 41 | "lib/netstandard1.0/Newtonsoft.Json.xml", 42 | "lib/netstandard1.3/Newtonsoft.Json.dll", 43 | "lib/netstandard1.3/Newtonsoft.Json.xml", 44 | "lib/netstandard2.0/Newtonsoft.Json.dll", 45 | "lib/netstandard2.0/Newtonsoft.Json.xml", 46 | "newtonsoft.json.13.0.3.nupkg.sha512", 47 | "newtonsoft.json.nuspec", 48 | "packageIcon.png" 49 | ] 50 | } 51 | }, 52 | "projectFileDependencyGroups": { 53 | "net9.0": [ 54 | "Newtonsoft.Json >= 13.0.3" 55 | ] 56 | }, 57 | "packageFolders": { 58 | "C:\\Users\\uwuertz\\.nuget\\packages\\": {} 59 | }, 60 | "project": { 61 | "version": "1.0.0", 62 | "restore": { 63 | "projectUniqueName": "C:\\Users\\uwuertz\\AI\\mcp-client\\mcp_login\\mcp_login.csproj", 64 | "projectName": "mcp_login", 65 | "projectPath": "C:\\Users\\uwuertz\\AI\\mcp-client\\mcp_login\\mcp_login.csproj", 66 | "packagesPath": "C:\\Users\\uwuertz\\.nuget\\packages\\", 67 | "outputPath": "C:\\Users\\uwuertz\\AI\\mcp-client\\mcp_login\\obj\\", 68 | "projectStyle": "PackageReference", 69 | "configFilePaths": [ 70 | "C:\\Users\\uwuertz\\AppData\\Roaming\\NuGet\\NuGet.Config" 71 | ], 72 | "originalTargetFrameworks": [ 73 | "net9.0" 74 | ], 75 | "sources": { 76 | "https://api.nuget.org/v3/index.json": {} 77 | }, 78 | "frameworks": { 79 | "net9.0": { 80 | "targetAlias": "net9.0", 81 | "projectReferences": {} 82 | } 83 | }, 84 | "warningProperties": { 85 | "warnAsError": [ 86 | "NU1605" 87 | ] 88 | }, 89 | "restoreAuditProperties": { 90 | "enableAudit": "true", 91 | "auditLevel": "low", 92 | "auditMode": "direct" 93 | }, 94 | "SdkAnalysisLevel": "9.0.100" 95 | }, 96 | "frameworks": { 97 | "net9.0": { 98 | "targetAlias": "net9.0", 99 | "dependencies": { 100 | "Newtonsoft.Json": { 101 | "target": "Package", 102 | "version": "[13.0.3, )" 103 | } 104 | }, 105 | "imports": [ 106 | "net461", 107 | "net462", 108 | "net47", 109 | "net471", 110 | "net472", 111 | "net48", 112 | "net481" 113 | ], 114 | "assetTargetFallback": true, 115 | "warn": true, 116 | "frameworkReferences": { 117 | "Microsoft.NETCore.App": { 118 | "privateAssets": "all" 119 | } 120 | }, 121 | "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.101/PortableRuntimeIdentifierGraph.json" 122 | } 123 | } 124 | } 125 | } ``` -------------------------------------------------------------------------------- /clients/C# .Net/1.1 mcp_logout/obj/project.assets.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "version": 3, 3 | "targets": { 4 | "net9.0": { 5 | "Newtonsoft.Json/13.0.3": { 6 | "type": "package", 7 | "compile": { 8 | "lib/net6.0/Newtonsoft.Json.dll": { 9 | "related": ".xml" 10 | } 11 | }, 12 | "runtime": { 13 | "lib/net6.0/Newtonsoft.Json.dll": { 14 | "related": ".xml" 15 | } 16 | } 17 | } 18 | } 19 | }, 20 | "libraries": { 21 | "Newtonsoft.Json/13.0.3": { 22 | "sha512": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", 23 | "type": "package", 24 | "path": "newtonsoft.json/13.0.3", 25 | "files": [ 26 | ".nupkg.metadata", 27 | ".signature.p7s", 28 | "LICENSE.md", 29 | "README.md", 30 | "lib/net20/Newtonsoft.Json.dll", 31 | "lib/net20/Newtonsoft.Json.xml", 32 | "lib/net35/Newtonsoft.Json.dll", 33 | "lib/net35/Newtonsoft.Json.xml", 34 | "lib/net40/Newtonsoft.Json.dll", 35 | "lib/net40/Newtonsoft.Json.xml", 36 | "lib/net45/Newtonsoft.Json.dll", 37 | "lib/net45/Newtonsoft.Json.xml", 38 | "lib/net6.0/Newtonsoft.Json.dll", 39 | "lib/net6.0/Newtonsoft.Json.xml", 40 | "lib/netstandard1.0/Newtonsoft.Json.dll", 41 | "lib/netstandard1.0/Newtonsoft.Json.xml", 42 | "lib/netstandard1.3/Newtonsoft.Json.dll", 43 | "lib/netstandard1.3/Newtonsoft.Json.xml", 44 | "lib/netstandard2.0/Newtonsoft.Json.dll", 45 | "lib/netstandard2.0/Newtonsoft.Json.xml", 46 | "newtonsoft.json.13.0.3.nupkg.sha512", 47 | "newtonsoft.json.nuspec", 48 | "packageIcon.png" 49 | ] 50 | } 51 | }, 52 | "projectFileDependencyGroups": { 53 | "net9.0": [ 54 | "Newtonsoft.Json >= 13.0.3" 55 | ] 56 | }, 57 | "packageFolders": { 58 | "C:\\Users\\uwuertz\\.nuget\\packages\\": {} 59 | }, 60 | "project": { 61 | "version": "1.0.0", 62 | "restore": { 63 | "projectUniqueName": "C:\\Users\\uwuertz\\AI\\mcp-client\\mcp_logout\\mcp_logout.csproj", 64 | "projectName": "mcp_logout", 65 | "projectPath": "C:\\Users\\uwuertz\\AI\\mcp-client\\mcp_logout\\mcp_logout.csproj", 66 | "packagesPath": "C:\\Users\\uwuertz\\.nuget\\packages\\", 67 | "outputPath": "C:\\Users\\uwuertz\\AI\\mcp-client\\mcp_logout\\obj\\", 68 | "projectStyle": "PackageReference", 69 | "configFilePaths": [ 70 | "C:\\Users\\uwuertz\\AppData\\Roaming\\NuGet\\NuGet.Config" 71 | ], 72 | "originalTargetFrameworks": [ 73 | "net9.0" 74 | ], 75 | "sources": { 76 | "https://api.nuget.org/v3/index.json": {} 77 | }, 78 | "frameworks": { 79 | "net9.0": { 80 | "targetAlias": "net9.0", 81 | "projectReferences": {} 82 | } 83 | }, 84 | "warningProperties": { 85 | "warnAsError": [ 86 | "NU1605" 87 | ] 88 | }, 89 | "restoreAuditProperties": { 90 | "enableAudit": "true", 91 | "auditLevel": "low", 92 | "auditMode": "direct" 93 | }, 94 | "SdkAnalysisLevel": "9.0.100" 95 | }, 96 | "frameworks": { 97 | "net9.0": { 98 | "targetAlias": "net9.0", 99 | "dependencies": { 100 | "Newtonsoft.Json": { 101 | "target": "Package", 102 | "version": "[13.0.3, )" 103 | } 104 | }, 105 | "imports": [ 106 | "net461", 107 | "net462", 108 | "net47", 109 | "net471", 110 | "net472", 111 | "net48", 112 | "net481" 113 | ], 114 | "assetTargetFallback": true, 115 | "warn": true, 116 | "frameworkReferences": { 117 | "Microsoft.NETCore.App": { 118 | "privateAssets": "all" 119 | } 120 | }, 121 | "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.101/PortableRuntimeIdentifierGraph.json" 122 | } 123 | } 124 | } 125 | } ```