|
1 | | -# tsurugi-mcp-server |
2 | | - |
3 | | -[Model Context Protocol](https://github.com/modelcontextprotocol) server to access [Tsurugi](https://github.com/project-tsurugi/tsurugidb). |
4 | | - |
5 | | -## Limitations |
6 | | - |
7 | | -- Tsurugi 1.4.0 or later. |
8 | | -- Java21 or later. |
9 | | - |
10 | | -## Components |
11 | | - |
12 | | -### Tools |
13 | | - |
14 | | -- `listTableNames` |
15 | | - - list table names. |
16 | | -- `getTableMetadata` |
17 | | - - get table metadata (table schema). |
18 | | - - parameter |
19 | | - - `tableName` - table name (string, required) |
20 | | -- `query` |
21 | | - - execute SQL (select). |
22 | | - - parameter |
23 | | - - `sql` - SQL (string, required) |
24 | | - - `transaction_type` - `OCC`, `LTX`, `RTX`. (string, default: `RTX`) |
25 | | - - `cursor` - To continue the previous query. (string) |
26 | | - - If there is a continuation, `nextCursor` is returned. |
27 | | -- `update` |
28 | | - - execute SQL (insert, update, delete). |
29 | | - - parameter |
30 | | - - `sql` - SQL (string, required) |
31 | | - - `transaction_type` - `OCC`, `LTX`. (string, default: `OCC`) |
32 | | - - `write_preserve` - write preserve table names. (string, required when `transaction_type` is `LTX`) |
33 | | -- `executeDdl` |
34 | | - - execute DDL (create, drop) |
35 | | - - parameter |
36 | | - - `sql` - SQL (string, required) |
37 | | - - `transaction_type` - `OCC`, `LTX`. (string, default: `OCC`) |
38 | | - |
39 | | -### Resources |
40 | | - |
41 | | -- table metadata |
42 | | - |
43 | | -### Prompts |
44 | | - |
45 | | -- `tableList-prompt` |
46 | | - - Prompt to display the list of tables. |
47 | | -- `tableMetadata-prompt` |
48 | | - - Prompt to display the table metadata. |
49 | | -- `query-prompt` |
50 | | - - Prompt to display the table data. |
51 | | - |
52 | | -## Configuration |
53 | | - |
54 | | -### Usage with Claude Desktop |
55 | | - |
56 | | -First, download the tsurugi-mcp-server jar file from [release page](https://github.com/project-tsurugi/tsurugi-mcp-server/releases). |
57 | | - |
58 | | -To use this server with the [Claude Desktop](https://claude.ai/download), add the following configuration to the "mcpServers" section of your `claude_desktop_config.json`: |
59 | | - |
60 | | -```json |
61 | | -{ |
62 | | - "mcpServers": { |
63 | | - "tsurugidb": { |
64 | | - "command": "java", |
65 | | - "args": [ |
66 | | - "-jar", |
67 | | - "/path/to/tsurugi-mcp-server-all.jar", |
68 | | - "-c", "tcp://localhost:12345" |
69 | | - ] |
70 | | - } |
71 | | - } |
72 | | -} |
73 | | -``` |
74 | | - |
75 | | -- `command` |
76 | | - - If the `java` command is not included in the PATH, specify the full path. (e.g., `"C:/Program Files/Java/jdk-21/bin/java"`) |
77 | | -- `args` |
78 | | - - Specify the jar file by full path. |
79 | | - - `-c` or `--connection` - the endpoint URL to connect Tsurugi. (required) |
80 | | - - If you want to limit the tools used, add `--enable-tools`. (e.g., for read-only access: `"--enable-tools", "listTableNames, getTableMetadata, query"`) |
81 | | - - If resources is not used, add `"--resource", "false"`. |
82 | | - - If prompts is not used, add `"--prompt", "false"`. |
83 | | - |
84 | | -## How to build |
85 | | - |
86 | | -```bash |
87 | | -cd tsurugi-mcp-server |
88 | | -./gradlew shadowJar |
89 | | -ls build/libs/ |
90 | | -``` |
91 | | - |
92 | | -## How to test |
93 | | - |
94 | | -```bash |
95 | | -cd tsurugi-mcp-server |
96 | | -./gradlew test -Pdbtest.endpoint=tcp://localhost:12345 |
97 | | -``` |
98 | | - |
99 | | -## License |
100 | | - |
101 | | -[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) |
| 1 | +# tsurugi-mcp-server |
| 2 | + |
| 3 | +[Model Context Protocol](https://github.com/modelcontextprotocol) server to access [Tsurugi](https://github.com/project-tsurugi/tsurugidb). |
| 4 | + |
| 5 | +## Limitations |
| 6 | + |
| 7 | +- Tsurugi 1.4.0 or later. |
| 8 | +- Java21 or later. |
| 9 | + |
| 10 | +## Components |
| 11 | + |
| 12 | +### Tools |
| 13 | + |
| 14 | +- `listTableNames` |
| 15 | + - list table names. |
| 16 | +- `getTableMetadata` |
| 17 | + - get table metadata (table schema). |
| 18 | + - parameter |
| 19 | + - `tableName` - table name (string, required) |
| 20 | +- `query` |
| 21 | + - execute SQL (select). |
| 22 | + - parameter |
| 23 | + - `sql` - SQL (string, required) |
| 24 | + - `transaction_type` - `OCC`, `LTX`, `RTX`. (string, default: `RTX`) |
| 25 | + - `cursor` - To continue the previous query. (string) |
| 26 | + - If there is a continuation, `nextCursor` is returned. |
| 27 | +- `update` |
| 28 | + - execute SQL (insert, update, delete). |
| 29 | + - parameter |
| 30 | + - `sql` - SQL (string, required) |
| 31 | + - `transaction_type` - `OCC`, `LTX`. (string, default: `OCC`) |
| 32 | + - `write_preserve` - write preserve table names. (string, required when `transaction_type` is `LTX`) |
| 33 | +- `executeDdl` |
| 34 | + - execute DDL (create, drop) |
| 35 | + - parameter |
| 36 | + - `sql` - SQL (string, required) |
| 37 | + - `transaction_type` - `OCC`, `LTX`. (string, default: `OCC`) |
| 38 | + |
| 39 | +### Resources |
| 40 | + |
| 41 | +- table metadata |
| 42 | + |
| 43 | +### Prompts |
| 44 | + |
| 45 | +- `tableList-prompt` |
| 46 | + - Prompt to display the list of tables. |
| 47 | +- `tableMetadata-prompt` |
| 48 | + - Prompt to display the table metadata. |
| 49 | +- `query-prompt` |
| 50 | + - Prompt to display the table data. |
| 51 | + |
| 52 | +## Configuration |
| 53 | + |
| 54 | +### Usage with Claude Desktop |
| 55 | + |
| 56 | +First, download the tsurugi-mcp-server jar file from [release page](https://github.com/project-tsurugi/tsurugi-mcp-server/releases). |
| 57 | + |
| 58 | +To use this server with the [Claude Desktop](https://claude.ai/download), add the following configuration to the "mcpServers" section of your `claude_desktop_config.json`: |
| 59 | + |
| 60 | +```json |
| 61 | +{ |
| 62 | + "mcpServers": { |
| 63 | + "tsurugidb": { |
| 64 | + "command": "java", |
| 65 | + "args": [ |
| 66 | + "-jar", |
| 67 | + "/path/to/tsurugi-mcp-server-all.jar", |
| 68 | + "-c", "tcp://localhost:12345" |
| 69 | + ] |
| 70 | + } |
| 71 | + } |
| 72 | +} |
| 73 | +``` |
| 74 | + |
| 75 | +- `command` |
| 76 | + - If the `java` command is not included in the PATH, specify the full path. (e.g., `"C:/Program Files/Java/jdk-21/bin/java"`) |
| 77 | +- `args` |
| 78 | + - Specify the jar file by full path. |
| 79 | + - `-c` or `--connection` - the endpoint URL to connect Tsurugi. (required) |
| 80 | + - If you want to limit the tools used, add `--enable-tools`. (e.g., for read-only access: `"--enable-tools", "listTableNames, getTableMetadata, query"`) |
| 81 | + - If resources is not used, add `"--resource", "false"`. |
| 82 | + - If prompts is not used, add `"--prompt", "false"`. |
| 83 | + |
| 84 | +## How to build |
| 85 | + |
| 86 | +```bash |
| 87 | +cd tsurugi-mcp-server |
| 88 | +./gradlew shadowJar |
| 89 | +ls build/libs/ |
| 90 | +``` |
| 91 | + |
| 92 | +## How to test |
| 93 | + |
| 94 | +```bash |
| 95 | +cd tsurugi-mcp-server |
| 96 | +./gradlew test -Pdbtest.endpoint=tcp://localhost:12345 |
| 97 | +``` |
| 98 | + |
| 99 | +## License |
| 100 | + |
| 101 | +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) |
0 commit comments