Skip to content

Commit 86a9c4d

Browse files
committed
feat: working version
1 parent 31ecdd1 commit 86a9c4d

25 files changed

+1781
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: golangci-lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
# Optional: allow read access to pull requests. Use with `only-new-issues` option.
12+
pull-requests: read
13+
14+
jobs:
15+
golangci:
16+
name: lint
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v5
21+
22+
- uses: actions/setup-go@v6
23+
with:
24+
go-version: stable
25+
26+
- name: golangci-lint
27+
uses: golangci/golangci-lint-action@v8
28+
with:
29+
version: v2.4
30+

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# .github/workflows/release.yml
2+
name: goreleaser
3+
4+
on:
5+
push:
6+
# Run only against tags
7+
tags:
8+
- "*"
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
goreleaser:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v5
19+
20+
- uses: actions/setup-go@v6
21+
with:
22+
go-version: stable
23+
24+
- name: Run GoReleaser
25+
uses: goreleaser/goreleaser-action@v6
26+
with:
27+
distribution: goreleaser
28+
# 'latest', 'nightly', or a semver
29+
version: "~> v2"
30+
args: release --clean
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# General
2+
*.nix
3+
.env*
4+
5+
# Added by goreleaser init:
6+
dist/

.golangci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
version: "2"
2+
3+
run:
4+
go: "1.25"
5+
6+
linters:
7+
default: all
8+
9+
disable:
10+
- depguard
11+
- mnd
12+
- wsl # Replaced by wsl_v5
13+
- cyclop # Revive handles this
14+
- exhaustruct
15+
# Stylistic preferences
16+
- varnamelen
17+
- noinlineerr
18+
- ireturn
19+
20+
settings:
21+
lll:
22+
line-length: 140
23+
24+
tagliatelle:
25+
case:
26+
rules:
27+
json: snake
28+
29+
revive:
30+
enable-all-rules: true
31+
rules:
32+
- name: add-constant
33+
disabled: true
34+
- name: exported
35+
disabled: true # Too annoying
36+
- name: line-length-limit
37+
disabled: true # We use lll for this
38+
- name: package-comments
39+
disabled: true # Too strict for a binary
40+
- name: cyclomatic
41+
arguments:
42+
- 15
43+
- name: cognitive-complexity
44+
arguments:
45+
- 15 # Yes, I'm aware this is insane, but whatever, this is a pet project
46+
47+
formatters:
48+
enable:
49+
- gci
50+
- gofmt
51+
- gofumpt
52+
- goimports
53+
- golines
54+
- swaggo

.goreleaser.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
version: 2
2+
3+
project_name: mcp_scaleway_functions
4+
5+
before:
6+
hooks:
7+
- go mod tidy
8+
9+
builds:
10+
- env:
11+
- CGO_ENABLED=0
12+
main: ./cmd/mcp_scaleway_functions
13+
ldflags:
14+
- -s -w -X main.Version={{.Version}}
15+
goos:
16+
- linux
17+
- windows
18+
- darwin
19+
20+
archives:
21+
- formats: [tar.gz]
22+
# this name template makes the OS and Arch compatible with the results of `uname`.
23+
name_template: >-
24+
{{ .ProjectName }}_
25+
{{- title .Os }}_
26+
{{- if eq .Arch "amd64" }}x86_64
27+
{{- else if eq .Arch "386" }}i386
28+
{{- else }}{{ .Arch }}{{ end }}
29+
{{- if .Arm }}v{{ .Arm }}{{ end }}
30+
# use zip for windows archives
31+
format_overrides:
32+
- goos: windows
33+
formats: [zip]
34+
35+
changelog:
36+
sort: asc
37+
filters:
38+
exclude:
39+
- "^docs:"
40+
- "^test:"
41+
42+
release:
43+
footer: >-
44+
45+
---
46+
47+
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).

LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <http://unlicense.org/>

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Unofficial MCP Server for Scaleway Functions
2+
3+
This is an unofficial implementation of a Model Context Protocol (MCP) server to manage and deploy [Scaleway Functions](https://www.scaleway.com/en/functions/) using the [Model Context Protocol (MCP)](https://modelcontextprotocol.org/) standard.
4+
5+
> [!CAUTION]
6+
> This project is unofficial and not affiliated with or endorsed by Scaleway.
7+
> Some small safety measures are in place to prevent the LLM from doing destructive actions,
8+
> but they're not foolproof.
9+
> Use at your own risk.
10+
11+
## Getting Started
12+
13+
Run the MCP server:
14+
15+
```bash
16+
go run ./cmd/mcp
17+
```
18+
19+
By default, the MCP server runs with the SSE transport on `http://localhost:8080`, but you can also change it to use Standard I/O (stdio) transport via the `--transport stdio` flag.
20+
21+
Configure your IDE to use the MCP server.
22+
23+
Example with VSCode and GitHub Copilot:
24+
25+
```jsonc
26+
// .vscode/mcp.json
27+
{
28+
"servers": {
29+
"scaleway": {
30+
"url": "http://localhost:8080",
31+
"type": "http",
32+
}
33+
},
34+
"inputs": []
35+
}
36+
```
37+
38+
That's it 🎉! Have fun vibecoding and vibedevopsing as you please.
39+
40+
## Configuration
41+
42+
You can use the standard [Scaleway environment variables](https://www.scaleway.com/en/docs/scaleway-cli/reference-content/environment-variables/) to configure the MCP server.
43+
44+
For instance, you can set a region to work in via the `SCW_DEFAULT_REGION` environment variable.
45+
46+
```bash
47+
SCW_DEFAULT_REGION=nl-ams go run ./cmd/mcp
48+
```
49+
50+
## Available Tools
51+
52+
| **Tool** | **Description** |
53+
| -------------------------------------- | -------------------------------------------------------------------------------- |
54+
| `create_and_deploy_function_namespace` | Create and deploy a new function namespace. |
55+
| `list_function_namespaces` | List all function namespaces. |
56+
| `delete_function_namespace` | Delete a function namespace. |
57+
| `list_functions` | List all functions in a namespace. |
58+
| `list_function_runtimes` | List all available function runtimes. |
59+
| `create_and_deploy_function` | Create and deploy a new function. |
60+
| `update_function` | Update the code or the configuration of an existing function. |
61+
| `delete_function` | Delete a function. |
62+
| `download_function` | Download the code of a function. This is useful to work on an existing function. |

0 commit comments

Comments
 (0)