mcp-server-config.yaml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. # MCP服务器配置 - 内网IRIS数据库连接
  2. # 最后更新: 2026-07-24
  3. # 配置连接内网服务器 172.16.2.15 上的InterSystems IRIS数据库
  4. version: "1.0"
  5. name: "drg-iris-mcp-server"
  6. description: "DRG医保控费预警系统IRIS数据库MCP服务器"
  7. author: "DRG开发团队"
  8. # 服务器连接配置
  9. server:
  10. type: "http"
  11. base_url: "http://172.16.2.15:52773"
  12. timeout: 30
  13. retry_policy:
  14. max_attempts: 3
  15. backoff_factor: 2
  16. retry_status_codes: [500, 502, 503, 504]
  17. # IRIS数据库连接配置
  18. database:
  19. type: "intersystems-iris"
  20. namespace: "USER"
  21. credentials:
  22. username: "_system"
  23. password: "pryk@2020"
  24. connection_params:
  25. host: "localhost"
  26. port: 52773
  27. web_app_path: "/csp/drg/sysInternalMutiple"
  28. charset: "UTF-8"
  29. pool_size: 10
  30. max_lifetime: 300
  31. # API端点配置
  32. endpoints:
  33. # DRG分组服务
  34. drg_group:
  35. path: "/iris-api/invoke"
  36. method: "POST"
  37. content_type: "application/json"
  38. auth_type: "bearer"
  39. timeout: 60
  40. description: "DRG分组接口调用"
  41. # 基础数据服务
  42. basic_data:
  43. path: "/iris-api/invoke"
  44. method: "POST"
  45. content_type: "application/json"
  46. description: "基础数据接口调用"
  47. # 预警服务
  48. warning:
  49. path: "/iris-api/invoke"
  50. method: "POST"
  51. content_type: "application/json"
  52. description: "预警接口调用"
  53. # 盈亏分析服务
  54. profit:
  55. path: "/iris-api/invoke"
  56. method: "POST"
  57. content_type: "application/json"
  58. description: "盈亏分析接口调用"
  59. # 认证配置
  60. authentication:
  61. # API密钥认证
  62. api_key:
  63. enabled: true
  64. header_name: "X-API-Key"
  65. required: true
  66. # 会话认证
  67. session:
  68. enabled: true
  69. token_refresh_interval: 1800
  70. session_timeout: 7200
  71. # 请求/响应格式
  72. request_format:
  73. structure:
  74. code: "string" # 接口代码,如02010001
  75. params: "array" # 接口参数数组
  76. session: "array" # 会话信息数组
  77. pagination: "optional" # 可选分页参数
  78. validation:
  79. required: ["code", "params", "session"]
  80. min_params: 1
  81. max_params: 50
  82. response_format:
  83. success:
  84. structure:
  85. errorCode: "0"
  86. errorMessage: ""
  87. result: "object|array"
  88. error:
  89. structure:
  90. errorCode: "string"
  91. errorMessage: "string"
  92. error_codes:
  93. "0": "成功"
  94. "-1": "业务逻辑失败"
  95. "-99": "系统异常"
  96. "1001": "参数错误"
  97. "1002": "会话过期"
  98. "1003": "权限不足"
  99. "2001": "数据不存在"
  100. "2002": "数据已存在"
  101. "3001": "服务器内部错误"
  102. # 接口服务映射
  103. interface_mapping:
  104. # DRG分组服务
  105. "02010001":
  106. name: "DRG分组器"
  107. class: "User.DRG.Warning"
  108. method: "QueryWarningRules"
  109. service_type: "S"
  110. description: "DRG分组核心接口"
  111. # 基础数据接口
  112. "02010101":
  113. name: "查询预警规则"
  114. class: "User.DRG.Warning"
  115. method: "QueryWarningRules"
  116. service_type: "S"
  117. description: "查询预警规则列表"
  118. "02010102":
  119. name: "保存预警规则"
  120. class: "User.DRG.Warning"
  121. method: "SaveWarningRule"
  122. service_type: "A"
  123. description: "保存预警规则"
  124. # 盈亏分析接口
  125. "02010201":
  126. name: "查询科室盈亏"
  127. class: "User.DRG.Profit"
  128. method: "QueryDeptProfit"
  129. service_type: "S"
  130. description: "查询科室盈亏统计"
  131. "02010202":
  132. name: "查询医生盈亏"
  133. class: "User.DRG.Profit"
  134. method: "QueryDoctorProfit"
  135. service_type: "S"
  136. description: "查询医生盈亏统计"
  137. # 系统管理接口
  138. "02010401":
  139. name: "查询用户列表"
  140. class: "User.DRG.System"
  141. method: "QuerySystemUsers"
  142. service_type: "S"
  143. description: "查询系统用户列表"
  144. "02010404":
  145. name: "查询接口服务"
  146. class: "User.DRG.System"
  147. method: "QueryInterfaceServices"
  148. service_type: "S"
  149. description: "查询已注册的接口服务"
  150. # 代理服务器配置(可选)
  151. proxy:
  152. enabled: true
  153. host: "localhost"
  154. port: 8090
  155. protocol: "http"
  156. # 如果需要身份验证
  157. auth:
  158. username: ""
  159. password: ""
  160. # 监控和日志
  161. monitoring:
  162. enabled: true
  163. metrics:
  164. request_count: true
  165. response_time: true
  166. error_rate: true
  167. logging:
  168. level: "info"
  169. format: "json"
  170. output: "stdout"
  171. rotate:
  172. enabled: true
  173. max_size: "100MB"
  174. max_files: 10
  175. # 健康检查
  176. health_check:
  177. enabled: true
  178. endpoint: "/health"
  179. interval: 30
  180. timeout: 5
  181. failure_threshold: 3
  182. success_threshold: 1
  183. # 缓存配置
  184. cache:
  185. enabled: true
  186. ttl: 300
  187. max_size: 1000
  188. strategy: "lru"
  189. # 安全配置
  190. security:
  191. ssl:
  192. enabled: false # 如果IRIS配置了SSL
  193. verify: false
  194. cert_path: ""
  195. cors:
  196. enabled: true
  197. allowed_origins: ["*"]
  198. allowed_methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"]
  199. allowed_headers: ["Content-Type", "Authorization", "X-API-Key"]
  200. rate_limiting:
  201. enabled: true
  202. requests_per_minute: 60
  203. burst_limit: 10
  204. # 部署配置(服务器已切换为 172.16.2.15)
  205. deployment:
  206. environment: "production"
  207. region: "local"
  208. server_type: "local"
  209. instance_id: ""
  210. access_info:
  211. ip_address: "172.16.2.15"
  212. ssh_port: 22
  213. username: ""
  214. password: ""
  215. # MCP工具配置
  216. tools:
  217. - name: "query_drg_data"
  218. description: "查询DRG相关数据"
  219. parameters:
  220. - name: "interface_code"
  221. type: "string"
  222. required: true
  223. description: "接口代码,如02010001"
  224. - name: "params"
  225. type: "array"
  226. required: false
  227. description: "查询参数数组"
  228. - name: "session"
  229. type: "object"
  230. required: true
  231. description: "会话信息"
  232. - name: "execute_drg_grouping"
  233. description: "执行DRG分组操作"
  234. parameters:
  235. - name: "patient_data"
  236. type: "object"
  237. required: true
  238. description: "病案首页数据"
  239. - name: "grouping_rules"
  240. type: "object"
  241. required: false
  242. description: "分组规则配置"
  243. - name: "get_warning_records"
  244. description: "获取预警记录"
  245. parameters:
  246. - name: "start_date"
  247. type: "string"
  248. required: false
  249. description: "开始日期,格式: YYYY-MM-DD"
  250. - name: "end_date"
  251. type: "string"
  252. required: false
  253. description: "结束日期,格式: YYYY-MM-DD"
  254. - name: "warning_level"
  255. type: "string"
  256. required: false
  257. description: "预警级别"
  258. # MCP资源配置
  259. resources:
  260. - type: "iris-database"
  261. uri: "iris://172.16.2.15:52773/USER"
  262. description: "内网IRIS数据库连接(172.16.2.15)"
  263. metadata:
  264. server_type: "InterSystems IRIS"
  265. namespace: "USER"
  266. credentials_stored: "secure"
  267. - type: "api-documentation"
  268. uri: "file://./接口服务说明/00-接口总览.md"
  269. description: "接口服务文档"
  270. # 配置版本信息
  271. metadata:
  272. version: "1.0.0"
  273. created: "2026-04-09"
  274. last_updated: "2026-04-09"
  275. environment: "production"
  276. project: "DRG医保控费预警系统"
  277. team: "DRG开发团队"
  278. repository: "https://github.com/your-org/drg-project"
  279. documentation: "https://docs.drg-project.com"