MCP tool’ları için guardrail ekleyen bir npm paketi yayınladım

MCP server yazarken fark ettiğim bir problem vardı: tool yazmak kolay ama agent’a açınca “bu tool nereye kadar yetkili olmalı?” kısmı biraz havada kalıyor.

Mesela read_file her dosyayı okuyabilmeli mi?
delete_file approval olmadan çalışmalı mı?
run_command rastgele komut çalıştırabilmeli mi?
Bir tool .env içeriğini dönerse bunu log’a yazmalı mıyız?

Bunun için ToolGate diye bir npm paketi hazırladım.

Var olan MCP tool handler’ını sarıp şu kuralları koyabiliyorsunuz:

  • read / write / external / destructive risk seviyesi
  • approval zorunluluğu
  • dosya yolu allowlist / denylist
  • domain allowlist / denylist
  • komut allowlist / denylist
  • timeout
  • rate limit
  • secret redaction
  • JSONL audit log
  • policy hatalarında düzenli response

Örnek:

server.tool(
  "delete_file",
  schema,
  gate({
    risk: "destructive",
    requireApproval: true,
    allowedPaths: ["src/**", "docs/**"],
    deniedPaths: [".env", "secrets/**"],
    audit: true,
    redact: true,
    timeoutMs: 10_000
  }, async (input) => {
    // gerçek tool logic burada
  })
);

MCP SDK’nın yerine geçmiyor; sadece tool handler’ın önüne policy katmanı koyuyor.

MCP server yazan varsa fikrini merak ederim. Siz böyle bir şeyi middleware olarak mı kullanırdınız, yoksa proxy/gateway tarafı daha mı mantıklı olurdu?

Repo: https://github.com/Wezylnia/toolgate
npm: toolgate-mcp

reddit.com
u/weesIinia — 6 days ago
▲ 6 r/TurkDev+3 crossposts

I made an npm package for adding guardrails to MCP tools

I’ve been working with MCP servers lately, and one thing I wanted was a clean way to put policies around tool handlers before exposing them to agents.

So I built ToolGate, a TypeScript npm package for MCP server authors.

It lets you wrap existing tools with policies like:

  • risk level: read / write / external / destructive
  • approval required
  • allowed / denied file paths
  • allowed / denied network domains
  • allowed / denied command strings
  • timeout
  • rate limit
  • secret redaction
  • JSONL audit logs
  • structured policy failure results

Example:

server.tool(
  "delete_file",
  schema,
  gate({
    risk: "destructive",
    requireApproval: true,
    allowedPaths: ["src/**", "docs/**"],
    deniedPaths: [".env", "secrets/**"],
    audit: true,
    redact: true,
    timeoutMs: 10_000
  }, async (input) => {
    // actual tool logic
  })
);

The goal is not to replace the MCP SDK. ToolGate is a policy layer for MCP tool handlers.

I’d like feedback from people building MCP servers:

  • Would this fit your current tool structure?
  • Would you prefer middleware, proxy/gateway, or both?
  • What policy types would you expect?

Repo: https://github.com/Wezylnia/toolgate
npm: toolgate-mcp

u/weesIinia — 6 days ago
▲ 1 r/TurkDev+1 crossposts

AI ile kod yazarken “ne değişti şimdi?” sorununa cevap olarak bir CLI tool yaptım

AI coding araçlarını kullanırken bende en çok yorucu olan kısım genelde kodu yazdırmak değil, sonrasında ne olduğunu anlamaya çalışmak oluyor.

Agent birkaç komut çalıştırıyor, birkaç dosyaya dokunuyor, bir testi düzeltirken başka bir şeyi bozabiliyor. En sonda terminal çıktısı, git diff ve test logları arasında gezip “tam olarak ne oldu?” diye bakmak gerekiyor.

Bunun için AgentTape diye küçük bir local CLI yaptım.

Session’ı kaydedip komut çıktısı, git değişiklikleri, test sinyalleri ve birkaç basit uyarıyla HTML/Markdown rapor çıkarıyor. Daha çok kendi agent run’larını incelemek veya PR’a özet eklemek için düşündüm.

Cloud’a bir şey göndermiyor, LLM çağırmıyor, agent olmaya çalışmıyor.

Repo: https://github.com/Wezylnia/agent-tape

Codex, Claude Code, Cursor tarzı araçları kullananlar için gerçekten işe yarar mı, yoksa fazla kendi workflow’uma göre mi düşünmüşüm merak ediyorum.

u/weesIinia — 10 days ago

[Self-promotion] I’m building a tool that tells you if a repo is worth trusting before you use it

Hi everyone,

I’m building Repository Trust Doctor, an open-source repository analysis tool focused on project quality, maintainability, and repository setup.

The goal is to help developers get a clearer picture of a repository before using it, reviewing it, or contributing to it. Instead of only showing a single score, the tool produces evidence-based findings with rule IDs, severity, confidence, evidence, and suggested actions.

Current capabilities include:

  • Static analysis of repository structure and maintenance signals
  • Review of GitHub Actions and workflow configuration
  • Basic checks for sensitive file names and suspicious patterns
  • Dockerfile and container configuration analysis
  • Dependency file and lockfile checks for npm, NuGet, and Python projects
  • Console, JSON, and Markdown report output
  • Trust profile information in reports
  • Stable finding fingerprints for tracking repeated findings across scans

I’m looking for feedback on the current direction, report format, analyzer categories, and rule ideas that would be useful for real-world open-source repositories.

Contributions are also welcome, especially around new analyzer rules, report improvements, dependency analysis, SARIF output, vulnerability/license metadata, and future reporting/dashboard features.

I’ll share the repository link in the comments.

reddit.com
u/weesIinia — 1 month ago
▲ 0 r/csharp+1 crossposts

[Self-promotion] I’m building an open-source repository analysis tool in C#

Hi everyone,

I’m building Repository Trust Doctor, an open-source repository analysis tool focused on project quality, maintainability, and repository setup.

The goal is to help developers get a clearer picture of a repository before using it, reviewing it, or contributing to it. Instead of only showing a single score, the tool produces evidence-based findings with rule IDs, severity, confidence, evidence, and suggested actions.

Current capabilities include:

  • Static analysis of repository structure and maintenance signals
  • Review of GitHub Actions and workflow configuration
  • Basic checks for sensitive file names and suspicious patterns
  • Dockerfile and container configuration analysis
  • Dependency file and lockfile checks for npm, NuGet, and Python projects
  • Console, JSON, and Markdown report output
  • Trust profile information in reports
  • Stable finding fingerprints for tracking repeated findings across scans

I’m looking for feedback on the current direction, report format, analyzer categories, and rule ideas that would be useful for real-world open-source repositories.

Contributions are also welcome, especially around new analyzer rules, report improvements, dependency analysis, SARIF output, vulnerability/license metadata, and future reporting/dashboard features.

I’ll share the repository link in the comments.

reddit.com
u/weesIinia — 1 month ago

Açık kaynak bir repo analiz aracı geliştiriyorum, geri bildirim almak isterim

Merhaba,

**Repository Trust Doctor** adında açık kaynak bir repo analiz aracı geliştiriyorum.

Projenin amacı; bir repoyu kullanmadan, incelemeden veya katkı vermeden önce proje kalitesi, sürdürülebilirlik durumu ve repo yapılandırması hakkında daha net bir fikir vermek.

Araç, repo dosyalarını statik olarak analiz ediyor ve bulguları kural ID’si, önem seviyesi, güven skoru, kanıt ve önerilen aksiyonlarla birlikte raporluyor.

Şu anda mevcut yetenekleri:

* Repo yapısını ve bakım sinyallerini statik olarak analiz eder.

* GitHub Actions ve workflow dosyalarındaki olası yapılandırma risklerini inceler.

* Hassas dosya adları ve şüpheli pattern’ler için temel kontroller yapar.

* Dockerfile ve container yapılandırmalarını analiz eder.

* npm, NuGet ve Python projelerinde dependency dosyalarını ve lockfile kullanımını kontrol eder.

* Console, JSON ve Markdown formatlarında rapor üretebilir.

* Her bulgu için kural ID’si, önem seviyesi, güven skoru, kanıt ve önerilen aksiyon bilgisi sunar.

* Raporlarda trust profile bilgisine yer verir.

* Tekrar eden taramalarda aynı bulguları takip edebilmek için stabil finding fingerprint üretir.

Şu an özellikle projenin yönü, rapor formatı, analiz kategorileri ve gerçek projelerde işe yarayabilecek kural fikirleri hakkında geri bildirim arıyorum.

Katkı vermek isteyenler için de yeni analyzer kuralları, rapor iyileştirmeleri, dependency analizi, SARIF çıktısı, vulnerability/license metadata ve ilerideki dashboard/raporlama özellikleri gibi alanlar açık.

Repo linkini yorumlara bırakacağım.

reddit.com
u/weesIinia — 1 month ago

Açık kaynak bir repo analiz aracı geliştiriyorum, geri bildirim almak isterim

Merhaba,

Repository Trust Doctor adında açık kaynak bir repo analiz aracı geliştiriyorum.

Projenin amacı; bir repoyu kullanmadan, incelemeden veya katkı vermeden önce proje kalitesi, sürdürülebilirlik durumu ve repo yapılandırması hakkında daha net bir fikir vermek.

Araç, repo dosyalarını statik olarak analiz ediyor ve bulguları kural ID’si, önem seviyesi, güven skoru, kanıt ve önerilen aksiyonlarla birlikte raporluyor.

Şu anda mevcut yetenekleri:

  • Repo yapısını ve bakım sinyallerini statik olarak analiz eder.
  • GitHub Actions ve workflow dosyalarındaki olası yapılandırma risklerini inceler.
  • Hassas dosya adları ve şüpheli pattern’ler için temel kontroller yapar.
  • Dockerfile ve container yapılandırmalarını analiz eder.
  • npm, NuGet ve Python projelerinde dependency dosyalarını ve lockfile kullanımını kontrol eder.
  • Console, JSON ve Markdown formatlarında rapor üretebilir.
  • Her bulgu için kural ID’si, önem seviyesi, güven skoru, kanıt ve önerilen aksiyon bilgisi sunar.
  • Raporlarda trust profile bilgisine yer verir.
  • Tekrar eden taramalarda aynı bulguları takip edebilmek için stabil finding fingerprint üretir.

Şu an özellikle projenin yönü, rapor formatı, analiz kategorileri ve gerçek projelerde işe yarayabilecek kural fikirleri hakkında geri bildirim arıyorum.

Katkı vermek isteyenler için de yeni analyzer kuralları, rapor iyileştirmeleri, dependency analizi, SARIF çıktısı, vulnerability/license metadata ve ilerideki dashboard/raporlama özellikleri gibi alanlar açık.

Repo linkini yorumlara bırakacağım.

reddit.com
u/weesIinia — 1 month ago