0Pricing
MCP Academy · Ders

Uzun Görevlerde İlerleme Gönderme

Tamamlanma yüzdesi güncellemelerini istemciye akışla gönderin.

Uzun Görevlerde İlerleme Gönderme, CoddyKit'te ücretsiz bir MCP Academy dersidir. Bu, 4 dersinin 1. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, MCP Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. MCP Academy kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Why Progress Matters

When a tool takes seconds or minutes, the client should not just hang. MCP lets your server send progress updates so the user sees movement.

The Progress Token

The client opts in by attaching a progressToken to the request. Without that token, your server simply skips sending updates.

Reach the Context Object

In the Python SDK, a tool receives a Context object. It is your handle for talking back to the client mid-call, including progress.

from mcp.server.fastmcp import Context

@mcp.tool()
async def crunch(n: int, ctx: Context) -> str:
    return "done"

Call report_progress

To push an update, you call ctx.report_progress. Each call tells the client how far along the work has come.

await ctx.report_progress(progress=3, total=10)

Progress and Total

The total argument is the finish line. The client can divide progress by total to draw a percent-done bar for the user.

await ctx.report_progress(progress=5, total=10)  # 50%

Update Inside a Loop

The natural place to report is inside your work loop. After each chunk finishes, send one update so the bar climbs steadily.

for i, item in enumerate(items):
    process(item)
    await ctx.report_progress(i + 1, len(items))

Progress Without a Total

Sometimes you cannot know the total upfront. You may omit it; the client then shows an indeterminate spinner instead of a precise bar.

await ctx.report_progress(progress=42)  # total unknown

Add an Optional Message

Many SDK versions let you attach a short message to a progress call, like "Indexing files", giving the user friendly human context.

await ctx.report_progress(2, 5, message="Fetching pages")

It Is a Notification

Progress travels as a JSON-RPC notification, so it has no reply and never blocks. Your tool keeps working while updates flow out.

Keep Updates Reasonable

Do not flood the client with thousands of tiny updates. Report at meaningful steps so the stream stays useful and lightweight.

Progress Plus a Result

Progress notifications are separate from your tool's return value. You stream updates as you go, then hand back the final result at the end.

await ctx.report_progress(10, 10)
return "index built"

Quick Check

Test your grasp of how progress reporting begins.

Recap: Progress

You learned to call ctx.report_progress with progress and total, loop your updates, and let the client draw a live bar. Nice work!

Sıkça Sorulan Sorular

“Uzun Görevlerde İlerleme Gönderme” dersi ücretsiz mi?

Evet — “Uzun Görevlerde İlerleme Gönderme” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve MCP Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. MCP Academy kursu toplamda 4 dersten oluşur.

“Uzun Görevlerde İlerleme Gönderme” dersinde ne öğreneceğim?

Tamamlanma yüzdesi güncellemelerini istemciye akışla gönderin. MCP Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

MCP Academy öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te MCP Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 1. dersidir.

“Uzun Görevlerde İlerleme Gönderme” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu MCP Academy dersinde kod yazıp çalıştırabilir miyim?

Evet. Her MCP Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Uzun Görevlerde İlerleme Gönderme
  2. İptal İsteklerini Ele Alma
  3. İstemciye Yapılandırılmış Günlükleme
  4. Günlük Seviyelerini Çalışma Zamanında Ayarlama
← MCP Academy Sayfasına Dön