-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add mcp server #246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: add mcp server #246
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ffef4d2
feat: add is_ai_generated field to quiz model and start implementing …
Antoni-Czaplicki 8f21b22
feat: add oauth mcp integration
Antoni-Czaplicki 8cf681f
fix: satisfy mcp ci checks
Antoni-Czaplicki cfe0e7f
fix: document cimd ssrf guard
Antoni-Czaplicki b399332
fix: require cimd metadata allowlist
Antoni-Czaplicki a431df5
fix: check cimd allowlist before resolving dns
Antoni-Czaplicki 9df0794
fix: address ai review feedback
Antoni-Czaplicki 32f2d2f
fix: keep cimd registration open
Antoni-Czaplicki 60d5e89
fix: address remaining ai review feedback
Antoni-Czaplicki 70d6441
refactor: share quiz operations across mcp and drf
Antoni-Czaplicki 440ba2b
fix: oauth migratiion
Antoni-Czaplicki 01e9951
fix: format code
Antoni-Czaplicki 73be98a
refactor: extract oauth authorize view to frontend
Antoni-Czaplicki bcb0d40
chore: use serializer for oauth apps list
Antoni-Czaplicki e058f52
feat: update mcp tools
Antoni-Czaplicki 556601f
feat: update mcp tools
Antoni-Czaplicki 8059399
feat: improve cimd metadata fetching
Antoni-Czaplicki 6285f1a
chore: remove unused functions
Antoni-Czaplicki 466c798
feat: improve cimd metadata fetching
Antoni-Czaplicki 055455a
fix: exclude oauth from drf auth classes
Antoni-Czaplicki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "servers": { | ||
| "testownik_local": { | ||
| "url": "http://localhost:8000/api/mcp", | ||
| "type": "http" | ||
| } | ||
| }, | ||
| "inputs": [] | ||
| } |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from django.contrib import admin | ||
| from unfold.admin import ModelAdmin | ||
|
|
||
| from oauth_integrations.models import OAuthClientMetadata | ||
|
|
||
|
|
||
| @admin.register(OAuthClientMetadata) | ||
| class OAuthClientMetadataAdmin(ModelAdmin): | ||
| list_display = ["client_name", "client_id_url", "application", "fetched_at", "cache_expires_at"] | ||
| list_filter = ["fetched_at", "cache_expires_at", "token_endpoint_auth_method"] | ||
| search_fields = ["client_name", "client_id_url", "client_uri"] | ||
| readonly_fields = ["fetched_at", "cache_expires_at"] | ||
|
|
||
| autocomplete_fields = ["application"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| from django.apps import AppConfig | ||
|
|
||
|
|
||
| class OAuthIntegrationsConfig(AppConfig): | ||
| default_auto_field = "django.db.models.BigAutoField" | ||
| name = "oauth_integrations" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Generated by Django 6.0.5 on 2026-06-03 07:42 | ||
|
|
||
| import uuid | ||
|
|
||
| import django.db.models.deletion | ||
| from django.conf import settings | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| initial = True | ||
|
|
||
| dependencies = [ | ||
| migrations.swappable_dependency(settings.OAUTH2_PROVIDER_APPLICATION_MODEL), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.CreateModel( | ||
| name="OAuthClientMetadata", | ||
| fields=[ | ||
| ( | ||
| "id", | ||
| models.UUIDField( | ||
| default=uuid.uuid4, | ||
| editable=False, | ||
| primary_key=True, | ||
| serialize=False, | ||
| ), | ||
| ), | ||
| ("client_id_url", models.URLField(max_length=2048, unique=True)), | ||
| ("client_name", models.CharField(max_length=255)), | ||
| ("client_uri", models.URLField(blank=True, max_length=2048)), | ||
| ("logo_uri", models.URLField(blank=True, max_length=2048)), | ||
| ("redirect_uris", models.JSONField(default=list)), | ||
| ("grant_types", models.JSONField(default=list)), | ||
| ("response_types", models.JSONField(default=list)), | ||
| ( | ||
| "token_endpoint_auth_method", | ||
| models.CharField(default="none", max_length=64), | ||
| ), | ||
| ("metadata", models.JSONField(default=dict)), | ||
| ("fetched_at", models.DateTimeField()), | ||
| ("cache_expires_at", models.DateTimeField(blank=True, null=True)), | ||
| ( | ||
| "application", | ||
| models.OneToOneField( | ||
| on_delete=django.db.models.deletion.CASCADE, | ||
| related_name="cimd_metadata", | ||
| to=settings.OAUTH2_PROVIDER_APPLICATION_MODEL, | ||
| ), | ||
| ), | ||
| ], | ||
| options={ | ||
| "verbose_name": "OAuth client metadata", | ||
| "verbose_name_plural": "OAuth client metadata", | ||
| }, | ||
| ), | ||
| ] |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import uuid | ||
|
|
||
| from django.db import models | ||
|
|
||
|
|
||
| class OAuthClientMetadata(models.Model): | ||
| id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) | ||
| application = models.OneToOneField( | ||
| "oauth2_provider.Application", | ||
| on_delete=models.CASCADE, | ||
| related_name="cimd_metadata", | ||
| swappable=False, | ||
| ) | ||
| client_id_url = models.URLField(max_length=2048, unique=True) | ||
| client_name = models.CharField(max_length=255) | ||
| client_uri = models.URLField(max_length=2048, blank=True) | ||
| logo_uri = models.URLField(max_length=2048, blank=True) | ||
| redirect_uris = models.JSONField(default=list) | ||
| grant_types = models.JSONField(default=list) | ||
| response_types = models.JSONField(default=list) | ||
| token_endpoint_auth_method = models.CharField(max_length=64, default="none") | ||
| metadata = models.JSONField(default=dict) | ||
| fetched_at = models.DateTimeField() | ||
| cache_expires_at = models.DateTimeField(null=True, blank=True) | ||
|
|
||
| class Meta: | ||
| verbose_name = "OAuth client metadata" | ||
| verbose_name_plural = "OAuth client metadata" | ||
|
|
||
| def __str__(self): | ||
| return self.client_name or self.client_id_url | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.