Feature: Add MCP (Model Context Protocol) server integration
Add an optional MCP server (JSON-RPC 2.0 over Streamable HTTP) exposing an online-host listing tool, protected by a Bearer token. Disabled by default; configured via a new "Extensions > MCP Settings" dialog. - McpServer: httplib + JSON-RPC 2.0 dispatch (initialize/ping/tools/list/tools/call) - McpSettingsDlg: runtime-created dialog for enable/port/bind/token - HostJson: extract single-host JSON serialization shared with WebService - FRP: expose MCP port (union with listening/Web ports) when bound to 0.0.0.0 - i18n: en_US / zh_TW translations Co-Authored-By: deepseek-v4-pro
This commit is contained in:
39
server/2015Remote/McpSettingsDlg.h
Normal file
39
server/2015Remote/McpSettingsDlg.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#include <afxwin.h>
|
||||
#include <afxcmn.h>
|
||||
#include <vector>
|
||||
|
||||
// 「MCP设置」配置对话框:启用 MCP / 端口 / 绑定地址 / Token。
|
||||
// 因 2015Remote.rc 为 UTF-16 编码、不宜手工编辑,参照 ZstaPickerDlg 用
|
||||
// InitModalIndirect + 内存 DLGTEMPLATE 程序化创建(见 docs/Mcp_Design.md §3.8)。
|
||||
class CMcpSettingsDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
explicit CMcpSettingsDlg(CWnd* parent = nullptr);
|
||||
|
||||
virtual INT_PTR DoModal();
|
||||
|
||||
protected:
|
||||
virtual BOOL OnInitDialog();
|
||||
virtual void OnOK();
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
enum CtrlId {
|
||||
IDC_MCP_ENABLE = 1001, // 「启用 MCP」复选框
|
||||
IDC_MCP_PORT = 1002, // 端口编辑框
|
||||
IDC_MCP_BIND = 1003, // 绑定地址编辑框
|
||||
IDC_MCP_TOKEN = 1004, // Token 编辑框
|
||||
};
|
||||
|
||||
CButton m_btnEnable;
|
||||
CStatic m_lblPort, m_lblBind, m_lblToken;
|
||||
CEdit m_editPort, m_editBind, m_editToken;
|
||||
CButton m_btnOK, m_btnCancel;
|
||||
|
||||
std::vector<BYTE> m_Template; // 内存 DLGTEMPLATE 字节
|
||||
|
||||
void LayoutControls(int cx, int cy);
|
||||
};
|
||||
Reference in New Issue
Block a user