<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/scaling-laravel-fixing-n-1-queries-and-building-an-mcp-server-for-ai-agents-ym5gh1jyn" -->

---
title: Scaling Laravel: Fixing N+1 Queries and Building an MCP...
description: A developer shares their experience optimizing LaraPlugins by eliminating N+1 query problems to achieve sub-second search speeds. They also announce building...
canonical: https://daily.dev/posts/scaling-laravel-fixing-n-1-queries-and-building-an-mcp-server-for-ai-agents-ym5gh1jyn
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Scaling Laravel: Fixing N+1 Queries and Building an MCP Server for AI Agents | daily.dev
og:description: A developer shares their experience optimizing LaraPlugins by eliminating N+1 query problems to achieve sub-second search speeds. They also announce building...
og:url: https://daily.dev/posts/scaling-laravel-fixing-n-1-queries-and-building-an-mcp-server-for-ai-agents-ym5gh1jyn
og:image: https://api.daily.dev/og/posts/YM5gH1jYN.png
og:image:alt: Scaling Laravel: Fixing N+1 Queries and Building an MCP Server for AI Agents
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Scaling Laravel: Fixing N+1 Queries and Building an MCP Server for AI Agents

**[Tech explorations](https://daily.dev/sources/techexplorations)** · [@danielpetrica](https://daily.dev/danielpetrica) · 1 min read · 7 upvotes · 0 comments

## Summary

A developer shares their experience optimizing LaraPlugins by eliminating N+1 query problems to achieve sub-second search speeds. They also announce building an MCP (Model Context Protocol) server for the site to enable AI agent integration.

## Content

When building for scale, technical debt eventually knocks on the door. This weekend, I optimized LaraPlugins to achieve sub-second search speeds by eliminating N+1 query bottlenecks.

But the bigger news? I'm building an MCP server for the site click the image bellow
[![Running PHP 8.5 with Laravel Octane & FrankenPHP(1)](https://media.daily.dev/image/upload/s--F6S21yTG--/f_auto/v1768763230/ugc/content_d2acbf67-8f64-443b-842d-2b49a8fc56bb?_a=BAMAMiiu0)
](https://coz.jp/CkcRDP)

## Similar posts on daily.dev

- [Laravel MCP: A Complete Guide](https://daily.dev/posts/laravel-mcp-a-complete-guide-zxqn7ceg1) · Laravel · 6 upvotes · 0 comments
- [Reusing your Laravel MCP tools in the Laravel AI SDK](https://daily.dev/posts/reusing-your-laravel-mcp-tools-in-the-laravel-ai-sdk-mfjaemkmb) · FREEK.DEV · 2 upvotes · 0 comments
- [Bridging the Gap - How We Made AI Agents 10x Developers in Our Organization](https://daily.dev/posts/bridging-the-gap---how-we-made-ai-agents-10x-developers-in-our-organization-9xldqiaaq) · DEV · 4 upvotes · 0 comments
- [Laravel Releases Nightwatch MCP Server for Claude Code and AI Agents](https://daily.dev/posts/laravel-releases-nightwatch-mcp-server-for-claude-code-and-ai-agents-biorg6cod) · Laravel News · 21 upvotes · 2 comments
- [Build and Deploy an App Prototype with an AI Agent using MCP in an Afternoon](https://daily.dev/posts/build-and-deploy-an-app-prototype-with-an-ai-agent-using-mcp-in-an-afternoon-hdtdzu1ly) · SingleStore · 0 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#database](https://daily.dev/tags/database), [#php](https://daily.dev/tags/php), [#laravel](https://daily.dev/tags/laravel)

[View this post on daily.dev](https://daily.dev/posts/scaling-laravel-fixing-n-1-queries-and-building-an-mcp-server-for-ai-agents-ym5gh1jyn)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/scaling-laravel-fixing-n-1-queries-and-building-an-mcp-server-for-ai-agents-ym5gh1jyn","headline":"Scaling Laravel: Fixing N+1 Queries and Building an MCP Server for AI Agents","text":"A developer shares their experience optimizing LaraPlugins by eliminating N+1 query problems to achieve sub-second search speeds. They also announce building an MCP (Model Context Protocol) server for the site to enable AI agent integration.","url":"https://daily.dev/posts/scaling-laravel-fixing-n-1-queries-and-building-an-mcp-server-for-ai-agents-ym5gh1jyn","datePublished":"2026-01-18T19:08:50.868Z","dateModified":"2026-01-18T19:09:57.438Z","author":{"@type":"Person","name":"Daniel, Petrica Andrei-Daniel","url":"https://daily.dev/danielpetrica","image":"https://avatars.githubusercontent.com/u/4850686?v=4","description":"Featured Laravel Artisan, DevOps & New Relic Consultant | Building Scalable Systems with Precision \n","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":2030}},"image":"https://media.daily.dev/image/upload/s--IPeXw6J_--/f_auto/v1768763331/posts/YM5gH1jYN?_a=BAMAMiiu0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":7},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/techexplorations","name":"Tech explorations"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Tech explorations","item":"https://daily.dev/squads/techexplorations"},{"@type":"ListItem","position":3,"name":"Scaling Laravel: Fixing N+1 Queries and Building an MCP Server for AI Agents"}]}
```

