gitlab_get_file
Pack: gitlab · Endpoint: https://gateway.pipeworx.io/gitlab/mcp
Fetch file content from a GitLab repository by project ID and file path (e.g., “src/main.py”). Returns decoded content, file size, name, and encoding.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
_apiKey | string | yes | GitLab personal access token |
project_id | string | yes | Project ID or URL-encoded path |
file_path | string | yes | Path to the file within the repository |
ref | string | no | Branch, tag, or commit SHA (default: default branch) |
Example call
Arguments
{
"_apiKey": "your-gitlab-api-key",
"project_id": "123",
"file_path": "README.md"
}
curl
curl -X POST https://gateway.pipeworx.io/gitlab/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"gitlab_get_file","arguments":{"_apiKey":"your-gitlab-api-key","project_id":"123","file_path":"README.md"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('gitlab_get_file', {
"_apiKey": "your-gitlab-api-key",
"project_id": "123",
"file_path": "README.md"
});
More examples
{
"_apiKey": "your-gitlab-api-key",
"project_id": "123",
"file_path": "src/main.py",
"ref": "develop"
}
Response shape
Always returns: file_name, file_path, size, ref, last_commit, content
| Field | Type | Description |
|---|---|---|
file_name | string | File name |
file_path | string | File path in repository |
size | number | File size in bytes |
ref | string | Git ref (branch/tag/commit) |
last_commit | string | Last commit SHA |
content | string | Decoded file content |
Full JSON Schema
{
"type": "object",
"properties": {
"file_name": {
"type": "string",
"description": "File name"
},
"file_path": {
"type": "string",
"description": "File path in repository"
},
"size": {
"type": "number",
"description": "File size in bytes"
},
"ref": {
"type": "string",
"description": "Git ref (branch/tag/commit)"
},
"last_commit": {
"type": "string",
"description": "Last commit SHA"
},
"content": {
"type": "string",
"description": "Decoded file content"
}
},
"required": [
"file_name",
"file_path",
"size",
"ref",
"last_commit",
"content"
]
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"gitlab": {
"url": "https://gateway.pipeworx.io/gitlab/mcp"
}
}
}
See Getting Started for client-specific install steps.