LOEMIND.txt 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. ========================================
  2. MCP FILESYSTEM – SEADISTUS ja KASUTUSJUHEND
  3. ========================================
  4. Asukoht serveris: /opt/docker-compose/third/server/mcp-filesystem
  5. Andmete kaust: /data/mcp-filesystem
  6. Tailscale IP: 100.87.1.24
  7. Serveri hostname: ohmu
  8. ------------------------------------------------
  9. 1. MIS SEE ON?
  10. ------------------------------------------------
  11. MCP (Model Context Protocol) failiserver võimaldab AI
  12. assistentidel (opencode, Claude Desktop, VS Code jne)
  13. lugeda, kirjutada ja hallata faile läbi standardse MCP
  14. liidese.
  15. ------------------------------------------------
  16. 2. KUIDAS KÄIVITADA?
  17. ------------------------------------------------
  18. cd /opt/docker-compose/third/server/mcp-filesystem
  19. bash run.sh
  20. See käivitab kaks konteinerit:
  21. a) mcp-filesystem – stdio-põhine (docker-compose)
  22. b) mcp-filesystem-sse – SSE/HTTP endpoint (docker run)
  23. ------------------------------------------------
  24. 3. KONTEINERITE EHITAMINE
  25. ------------------------------------------------
  26. Stdio image:
  27. docker build -t mcp/filesystem -f src/filesystem/Dockerfile .
  28. SSE image (vajab Node.js + Python mcp-proxy):
  29. docker build -t mcp-filesystem-sse /opt/docker-compose/third/server/mcp-filesystem
  30. ------------------------------------------------
  31. 4. ÜHENDAMINE OPENCODE'GA
  32. ------------------------------------------------
  33. 4a. SAMAS MASINAS (kohalik stdio):
  34. opencode.json:
  35. {
  36. "mcp": {
  37. "filesystem": {
  38. "type": "local",
  39. "command": [
  40. "docker", "run", "-i", "--rm",
  41. "--mount", "type=bind,src=/data/mcp-filesystem,dst=/projects/data",
  42. "mcp/filesystem",
  43. "/projects"
  44. ]
  45. }
  46. }
  47. }
  48. 4b. TEISES MASINAS (üle Tailscale, HTTP/SSE):
  49. opencode.json:
  50. {
  51. "mcp": {
  52. "filesystem": {
  53. "type": "remote",
  54. "url": "http://100.87.1.24:3100/sse"
  55. }
  56. }
  57. }
  58. 4c. TEISES MASINAS (üle Tailscale, SSH stdio):
  59. opencode.json:
  60. {
  61. "mcp": {
  62. "filesystem": {
  63. "type": "local",
  64. "command": [
  65. "ssh", "ardo@100.87.1.24",
  66. "docker", "exec", "-i", "mcp-filesystem",
  67. "node", "/app/dist/index.js", "/projects"
  68. ]
  69. }
  70. }
  71. }
  72. Eeldus: SSH võti on seadistatud (ssh-copy-id ohmu@100.87.1.24)
  73. ------------------------------------------------
  74. 5. MCP TÖÖRIISTAD (AI-le saadaval)
  75. ------------------------------------------------
  76. - filesystem_list_allowed_directories
  77. - filesystem_list_directory
  78. - filesystem_list_directory_with_sizes
  79. - filesystem_read_text_file
  80. - filesystem_read_multiple_files
  81. - filesystem_write_file
  82. - filesystem_edit_file
  83. - filesystem_create_directory
  84. - filesystem_read_media_file
  85. - filesystem_get_file_info
  86. - filesystem_move_file
  87. - filesystem_search_files
  88. - filesystem_directory_tree
  89. ------------------------------------------------
  90. 6. TESTIMINE
  91. ------------------------------------------------
  92. Pärast ühendamist küsi AI-lt:
  93. "Loetle failid kaustas /projects/data"
  94. "Millised MCP tööriistad sul saadaval on?"
  95. ------------------------------------------------
  96. 7. SÜSTEEMI TAASTAMINE (puhtalt uuesti)
  97. ------------------------------------------------
  98. Kui kogu süsteem on kadunud:
  99. 7a. Klooni MCP serverite repo:
  100. git clone https://github.com/modelcontextprotocol/servers.git
  101. cd servers
  102. docker build -t mcp/filesystem -f src/filesystem/Dockerfile .
  103. 7b. Loo SSE image:
  104. cd /opt/docker-compose/third/server/mcp-filesystem
  105. docker build -t mcp-filesystem-sse .
  106. 7c. Käivita:
  107. bash run.sh
  108. 7d. Lisa opencode.json ja taaskäivita opencode.
  109. ------------------------------------------------
  110. 8. FAILIDE ASUKOHT
  111. ------------------------------------------------
  112. Andmed: /data/mcp-filesystem
  113. Varukoopia: /backups/docker/mcp-fileserver
  114. ------------------------------------------------
  115. 9. n8n MCP KLIENT
  116. ------------------------------------------------
  117. n8n (v2.13+) saab kasutada MCP servereid workflow'des.
  118. Seadistus:
  119. - Loodud: /data/docker/n8n/mcp.json
  120. - Endpoint: http://100.87.1.24:3100/sse
  121. - N8N_MCP_TOOLS_ENABLED=true lisatud docker-compose.env
  122. Kasutamine n8n-s:
  123. - Ava https://n8n.tail20e23.ts.net
  124. - Uus workflow → otsi "MCP Client" node
  125. - Endpoint URL: http://100.87.1.24:3100/sse
  126. - Type: SSE
  127. - Nüüd saad workflow'des lugeda/kirjutada faile.
  128. ------------------------------------------------
  129. 10. INTEGREERITUD TEENUSED
  130. ------------------------------------------------
  131. MCP kaudu nähtavad:
  132. /projects/data/ – docker-compose konfiguratsioonid
  133. /projects/n8n/ – n8n andmebaas ja logid
  134. /projects/n8n-workflows – 15 eksporditud workflow'd
  135. /projects/anythingllm/ – dokumendid, vektorbaas
  136. /projects/open-webui/ – 2410 üleslaetud faili
  137. /projects/backups/ – varukoopiad
  138. ------------------------------------------------
  139. 11. LISATEE
  140. ------------------------------------------------
  141. Lähemalt loe: https://opencode.ai/docs/mcp/servers/