You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "CodePrometheus (via GitHub)" <gi...@apache.org> on 2025/06/02 15:47:37 UTC

[PR] Add support mcp server for SkyWalking - stage1 [skywalking-mcp]

CodePrometheus opened a new pull request, #1:
URL: https://github.com/apache/skywalking-mcp/pull/1

   pending related issue and docs update


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add support mcp server for SkyWalking - stage1 [skywalking-mcp]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #1:
URL: https://github.com/apache/skywalking-mcp/pull/1#issuecomment-2942411489

   Is MCP server able to run? If yes, could you post some screenshots of running?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add support mcp server for SkyWalking - stage1 [skywalking-mcp]

Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus merged PR #1:
URL: https://github.com/apache/skywalking-mcp/pull/1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add support mcp server for SkyWalking - stage1 [skywalking-mcp]

Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 commented on code in PR #1:
URL: https://github.com/apache/skywalking-mcp/pull/1#discussion_r2131280584


##########
.github/workflows/publish-docker.yaml:
##########
@@ -0,0 +1,54 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: publish-docker
+
+on:
+  push:
+    branches:
+      - main
+
+env:
+  SKIP_TEST: true
+  HUB: ghcr.io/apache/skywalking-mcp
+
+jobs:
+  build:
+    if: github.repository == 'apache/skywalking-mcp'
+    runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      packages: write
+    timeout-minutes: 30
+    env:
+      VERSION: ${{ github.sha }}
+      APP_NAME: skywalking-mcp
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          submodules: true
+      - name: Set up Go
+        uses: actions/setup-go@v4
+        with:
+          go-version: 1.24
+      - name: Log in to the Container registry
+        uses: docker/login-action@v1.10.0

Review Comment:
   v1 is too old, current version is v3



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add support mcp server for SkyWalking - stage1 [skywalking-mcp]

Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on PR #1:
URL: https://github.com/apache/skywalking-mcp/pull/1#issuecomment-2944984154

   > Is MCP server able to run? If yes, could you post some screenshots of running?
   
   
   https://github.com/user-attachments/assets/f7d08a36-be37-4d6e-9f8d-d8f1ac3774f9
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add support mcp server for SkyWalking - stage1 [skywalking-mcp]

Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 commented on code in PR #1:
URL: https://github.com/apache/skywalking-mcp/pull/1#discussion_r2127768316


##########
.github/workflows/CI.yaml:
##########
@@ -0,0 +1,86 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: CI
+
+on:
+  pull_request:
+  push:
+    branches:
+      - master
+  schedule:
+    - cron: "0 18 * * *" # TimeZone: UTC 0

Review Comment:
   we don’t want to run this every day



##########
.github/workflows/CI.yaml:
##########
@@ -0,0 +1,86 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: CI
+
+on:
+  pull_request:
+  push:
+    branches:
+      - master
+  schedule:
+    - cron: "0 18 * * *" # TimeZone: UTC 0
+
+concurrency:
+  group: skywalking-mcp-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  check-license:
+    name: License header
+    if: github.repository == 'apache/skywalking-mcp'
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Check License Header
+        uses: apache/skywalking-eyes@5dfa68f93380a5e57259faaf95088b7f133b5778
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+      - name: Setup Go
+        uses: actions/setup-go@v5
+        with:
+          go-version: "1.24"
+
+      - name: Check Dependencies License
+        run: make dependency-license

Review Comment:
   We don’t want to check the dependencies’ license files any more, we would generate these files when releasing (so please remove the folder `dist/licenses`, but let’s keep checking the dependencies compatibility like https://github.com/apache/skywalking-satellite/blob/da3865787a5e51b0b2b9ba8b9be896d1e6ba2a30/.github/workflows/build-and-test.yaml#L44-L50
   
   I know the cli repo is still doing this, but let’s simplify the contribution process (dependabot updating process) for new projects



##########
.github/workflows/CI.yaml:
##########
@@ -0,0 +1,86 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: CI
+
+on:
+  pull_request:
+  push:
+    branches:
+      - master

Review Comment:
   ```suggestion
         - main
   ```



##########
.asf.yaml:
##########
@@ -29,3 +29,13 @@ github:
     squash: true
     merge: false
     rebase: false
+  dependabot_updates: false

Review Comment:
   We want to enable dependabot updates



##########
.asf.yaml:
##########
@@ -29,3 +29,13 @@ github:
     squash: true
     merge: false
     rebase: false
+  dependabot_updates: false
+  protected_branches:
+    master:

Review Comment:
   ```suggestion
       main:
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add support mcp server for SkyWalking - stage1 [skywalking-mcp]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #1:
URL: https://github.com/apache/skywalking-mcp/pull/1#discussion_r2127735812


##########
internal/tools/tools.go:
##########
@@ -0,0 +1,102 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package tools
+
+import (
+	"context"
+	"encoding/json"
+	"fmt"
+
+	"github.com/mark3labs/mcp-go/mcp"
+	"github.com/mark3labs/mcp-go/server"
+)
+
+type Tool[T any, R any] struct {
+	Name        string
+	Description string
+	Handler     func(ctx context.Context, args T) (R, error)
+	Options     []mcp.ToolOption
+}
+
+func NewTool[T any, R any](
+	name, desc string,
+	handler func(ctx context.Context, args T) (R, error),
+	options ...mcp.ToolOption,
+) *Tool[T, R] {
+	return &Tool[T, R]{
+		Name:        name,
+		Description: desc,
+		Handler:     handler,
+		Options:     options,
+	}
+}
+
+// Register registers the tool with the given MCP server.
+func (t *Tool[T, R]) Register(server *server.MCPServer) {
+	tool, handler, err := ConvertTool[T, R](t.Name, t.Description, t.Handler, t.Options...)
+	if err != nil {
+		panic(err)
+	}
+
+	server.AddTool(tool, handler)

Review Comment:
   Consider handling the error returned by ConvertTool instead of calling panic to allow for graceful error propagation and recovery.
   ```suggestion
   func (t *Tool[T, R]) Register(server *server.MCPServer) error {
   	tool, handler, err := ConvertTool[T, R](t.Name, t.Description, t.Handler, t.Options...)
   	if err != nil {
   		return fmt.Errorf("failed to convert tool: %w", err)
   	}
   
   	server.AddTool(tool, handler)
   	return nil
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add support mcp server for SkyWalking - stage1 [skywalking-mcp]

Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on code in PR #1:
URL: https://github.com/apache/skywalking-mcp/pull/1#discussion_r2127738847


##########
internal/tools/tools.go:
##########
@@ -0,0 +1,102 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package tools
+
+import (
+	"context"
+	"encoding/json"
+	"fmt"
+
+	"github.com/mark3labs/mcp-go/mcp"
+	"github.com/mark3labs/mcp-go/server"
+)
+
+type Tool[T any, R any] struct {
+	Name        string
+	Description string
+	Handler     func(ctx context.Context, args T) (R, error)
+	Options     []mcp.ToolOption
+}
+
+func NewTool[T any, R any](
+	name, desc string,
+	handler func(ctx context.Context, args T) (R, error),
+	options ...mcp.ToolOption,
+) *Tool[T, R] {
+	return &Tool[T, R]{
+		Name:        name,
+		Description: desc,
+		Handler:     handler,
+		Options:     options,
+	}
+}
+
+// Register registers the tool with the given MCP server.
+func (t *Tool[T, R]) Register(server *server.MCPServer) {
+	tool, handler, err := ConvertTool[T, R](t.Name, t.Description, t.Handler, t.Options...)
+	if err != nil {
+		panic(err)
+	}
+
+	server.AddTool(tool, handler)

Review Comment:
   No need to return error here, panic is enough, caller does not need to handle it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org