Skip to content

Commit e5bf04d

Browse files
authored
Improve MCP Server connection guide (#30)
* Add CopyToClipboard for MCP endpoint * Add LearnMore link for auth tokens
1 parent 63cfbd8 commit e5bf04d

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

lang/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"ConnectInClientStepEndpoint": "Set the MCP server URL.",
99
"ConnectInClientStepInitialize": "Save the configuration and connect.",
1010
"ConnectInClientStepOpenSettings": "Open your MCP client settings and find the MCP server configuration.",
11-
"ConnectInClientTokenHelp": "In Matomo, go to: %1$sPersonal Settings -> Security -> Auth tokens%2$s. Create a token (or reuse an existing one) and use it as your %3$stoken_auth%4$s.",
11+
"ConnectInClientTokenHelp": "In Matomo, go to: %1$sPersonal Settings -> Security -> Auth tokens%2$s. Create a token (or reuse an existing one) and use it as your %3$stoken_auth%4$s. %5$sLearn more about auth tokens%6$s.",
1212
"ConnectInClientTitle": "Connect Your MCP Client",
1313
"ConnectIntro": "Use this guide to connect any MCP client to your Matomo MCP Server.",
1414
"ConnectMcpDisabledCanEnable": "MCP Server is currently disabled. %1$sEnable it in Plugin Settings%2$s to start accepting MCP requests.",

stylesheets/mcpServer.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
.mcpServerConnect {
2+
.mcpServerCopyField {
3+
margin: 0 0 1rem;
4+
padding-right: 4.5rem;
5+
}
6+
7+
.mcpServerCopyValue {
8+
margin: 0;
9+
white-space: pre-wrap;
10+
overflow-wrap: anywhere;
11+
}
12+
213
.mcpServerLongCode {
314
word-break: break-all;
415
}

templates/connect.twig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
{% if isMcpEnabled %}
3939
<div vue-entry="CoreHome.ContentBlock" content-title="{{ 'McpServer_ConnectEndpointTitle'|translate }}" anchor="endpoint">
4040
<p>{{ 'McpServer_ConnectEndpointDescription'|translate }}</p>
41-
<p><code class="mcpServerLongCode">{{ mcpApiEndpoint }}</code></p>
41+
<div class="mcpServerCopyField">
42+
<pre class="mcpServerLongCode mcpServerCopyValue" vue-directive="CoreHome.CopyToClipboard">{{ mcpApiEndpoint }}</pre>
43+
</div>
4244
</div>
4345

4446
<div vue-entry="CoreHome.ContentBlock" content-title="{{ 'McpServer_ConnectInClientTitle'|translate }}" anchor="set-up-client">
@@ -55,7 +57,7 @@
5557
<li>{{ 'McpServer_ConnectInClientStepInitialize'|translate }}</li>
5658
</ol>
5759
<h3>{{ 'McpServer_ConnectTokenTitle'|translate }}</h3>
58-
<p>{{ 'McpServer_ConnectInClientTokenHelp'|translate('<a href="' ~ userSecurityUrl ~ '">', '</a>', '<code>', '</code>')|raw }}</p>
60+
<p>{{ 'McpServer_ConnectInClientTokenHelp'|translate('<a href="' ~ userSecurityUrl ~ '">', '</a>', '<code>', '</code>', externallink('https://matomo.org/faq/general/faq_114/'), '</a>')|raw }}</p>
5961
</div>
6062

6163
<div vue-entry="CoreHome.ContentBlock" content-title="{{ 'McpServer_ConnectTroubleshootingTitle'|translate }}" anchor="troubleshooting">

0 commit comments

Comments
 (0)